example


Code:

Break On

Dim $Computers,$Computer
 
$Computers=ReadFile(@ScriptDir+'\'+'workstations.txt')
For Each $Computer In $Computers
If $Computer
$Computer ?
;SHELL '%COMSPEC% /e:1024 /c NETDOM and your switches'
EndIf
Next
 

Function ReadFile($file)
Dim $lf, $f, $_, $t
$lf=CHR(10)
$f=FreeFileHandle
$_=Open($f,$file)
If @ERROR Exit @ERROR EndIf
Do $t=$t+$lf+ReadLine($f) Until @ERROR
$_=Close($f)
$ReadFile=Split(SubStr($t,2),$lf)
EndFunction