; make sure following UDFs are either CALLed or pasted into the script:
; ReadFile
; Ping
; xlLib
; WMISvcMgr
; good coders declare their vars here... ;)
Dim $Data[0] ; need to declare as an array
; Prepare Excel
$oXL = xlInit() ; initialize Excel
$0WB = xlBookCreate($oXl,1) ; create a workbook
; verify function syntax
$Hosts = ReadFile('myListOfHosts.txt')
$Row = 2 ; row of first Excel data, after any headers
; enumerate hosts
For Each $Host in $Hosts
If Ping($Host) ; got a ping reply, so do effective test
$Junk = WMISvcMgr('list',,,$Host)
If Not @ERROR ; got a reply, so computer is alive *1
$Data[0] = $Host, 'Responds'
xlRangeValue($oXl, 'A'+CStr($Row), $Data) ; write in Col A, starting in $Row
$Row = $Row + 1 ; increment row pointer
EndIf
Else ; no response at all
$Data = $Host, 'Fails'
xlRangeValue($oXl, 'A'+CStr($Row), $Data)
; might want to consider formatting the data - red text for fail?
$Row = $Row + 1 ; increment row pointer
EndIf
Next
; might want to write some header cells before you exit
$ = xlFile($oXL, 1, 'log.xls') ; write the excel file
xlQuit($oXl) ; close the excel session