I took liberty to "syntax check" your code.
here is the result:
code:
$infile="c:\machines.txt" ; <-- contains your machine names, one per line
; read the input file for the computer(s) to be queried
If Open(3, "$infile") = 0
$computer = Ucase(Trim(ReadLine(3)))
While @error = 0
Gosub main ;do stuff
$computer = Ucase(Trim(ReadLine(3)))
Loop
$nul=Close(3)
EndIf

_________________________
!

download KiXnet