Rewritten again!!! If I leave it this way, it runs against the target computer fine... When I comment that $currentPC out and uncomment the other two for the loop, I get the error; am I calling ReadLine() incorrectly??? PLEASE HELP!!!!

Code:
Break ON
$ = SetOption("WrapAtEOL","ON")
Global $MyBIOSInfo
$ListFile = "C:\computer_list.txt"
$OutputFile = "C:\output_file.txt"
$OpenListFile = OPEN(4,$ListFile,2)
$OpenOutputFile = OPEN(5,$OutputFile,5)

$CurrentPC = "ecs-scbna-cjdw"

If $OpenListFile = 0
;$CurrentPC = ReadLine(4)
If $OpenOutputFile = 0

$MyBIOSInfo = GetBIOSInfo($CurrentPC)

? $MyBIOSInfo[1] + @CRLF
? $MyBIOSInfo[2] + @CRLF
? $MyBIOSInfo[3] + @CRLF
? $MyBIOSInfo[4] + @CRLF

;$CurrentPC = ReadLine(4)

Endif
Endif

Close(4)
Close(5)

sleep 5

Function GetBIOSInfo($Computer)
Dim $Computer, $WMIService, $BIOSItems, $BIOSName, $BIOSVersion, $SMBIOSVersion
Dim $Item, $SerialNumber, $Manufacturer, $BIOSArray[4]
;$Computer = "."
$WMIService = GetObject("winmgmts:\\" + $Computer + "\root\cimv2")
$BIOSItems = $WMIService.ExecQuery( "Select * from Win32_BIOS where PrimaryBIOS = true", , 48 )
For Each $Item in $BIOSItems
$BIOSName = Trim($Item.Name)
$BIOSVersion = Trim($Item.Version)
$SMBIOSVersion = Trim($Item.SMBIOSBIOSVersion)
$SerialNumber = Trim($Item.SerialNumber)
$Manufacturer = Trim($Item.Manufacturer)
Next
$BIOSArray[0]=$BIOSName $BIOSArray[1]=$BIOSVersion $BIOSArray[2]=$SMBIOSVersion $BIOSArray[3]=$SerialNumber
$BIOSArray[4]=$Manufacturer
$GetBIOSInfo=$BIOSArray
EndFunction



Edited by thepip3r (2006-01-25 11:50 PM)