This works for me:
Code:
$=SetOption("WrapAtEOL","ON")
For Each $sLine in WshPipe("cmdow.exe /b /t /f")
If $sLine
$sLine=Split($sLine)
$sHandle=$sLine[0]
$sLev=$sLine[1]
$sPID=$sLine[2]
$sStatus=$sLine[3]+","+$sLine[4]+","+$sLine[5]+","+$sLine[6]
$sImage=$sLine[7]
$sCaption=SubStr(Join($sLine),Len(Join($sLine," ",8))+2)
"'"+$sCaption+"'" ?
EndIf
Next

; WshPipe() ripped from Chris Shilt's UDF post: http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=82578&an=&page=0&vc=1
Function WshPipe($ShellCMD)
Dim $oExec, $Output
$oExec = CreateObject("WScript.Shell").Exec($ShellCMD)
If Not VarType($oExec)=9 $WshPipe="WScript.Shell Exec Unsupported" Exit 10 EndIf
$Output = $oExec.StdOut.ReadAll + $oExec.StdErr.ReadAll
$WshPipe=Split(Join(Split($Output,CHR(13)),''),CHR(10))
Exit($oExec.ExitCode)
EndFunction