The script returned this:
"CurrentPC = [pccomputername]"
And now it's acting like it's locked up and doesn't close unless I close it manually.
Here is what the code looks like:
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)
'CurrentPC = [' + $CurrentPC + ']' ?
Get $_
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