Code:
break on
$cmd='cmd /c nbtstat -c|find "<"'
$return=wshpipe($cmd,1)
for each $line in $return
if trim($line) > ' '
? $line
$computer = trim(split($line,'<')[0])
$ip = trim(left(trim(split($line,'UNIQUE')[1]),16))
? $computer
? $ip
?
endif
next
;********************************************************************************************
Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
While Not $oExec.Status Loop
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
If Not $NoEcho $Output Endif
$WshPipe=Split($Output,CHR(10))
Exit($oExec.ExitCode)
EndFunction