Ok, I pulled the function out in trying to troubleshoot and I still get the same error but now on line 17...
Code:
Break ON
$ = SetOption("WrapAtEOL","ON")
$LogFile = "C:\computer_list.txt"
$OutputFile = "C:\output_file.txt"
$OpenListFile = OPEN(4,$LogFile,2)
$OpenLogFile = OPEN(5,$OutputFile,5)
If $OpenListFile = 0
$CurrentPC = ReadLine(4)
If $OpenLogFile = 0
DO
? $CurrentPC
$WMIService = GetObject("winmgmts:\\" + $CurrentPC + "\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
$ = WRITELINE(5,"$CurrentPC, ")
$ = WRITELINE(5, $SerialNumber + @CRLF)
$CurrentPC = ReadLine(4)
UNTIL @ERROR = -1
ENDIF
ENDIF
CLOSE(4)
CLOSE(5)
Sleep 5
Any thoughts now?