W
Wensi Peng
Hello,
Can Exec object read lines from standard out after a pipe in command-line?
Below is my script. After I added |findstr in the command-line oExec does
not read anything from screen.
Any tips?
Thanks,
Wensi
strCommand = "%comspec% /c ping -n 1 " & strComputer & "|findstr /i ""reply
timed unknown"""
set oExec = Wshshell.Exec (strCommand)
Do Until oExec.StdOut.atEndofStream
Wscript.Echo oExec.StdOut.Readline & " , " & Ucase(strComputer)
Loop
Can Exec object read lines from standard out after a pipe in command-line?
Below is my script. After I added |findstr in the command-line oExec does
not read anything from screen.
Any tips?
Thanks,
Wensi
strCommand = "%comspec% /c ping -n 1 " & strComputer & "|findstr /i ""reply
timed unknown"""
set oExec = Wshshell.Exec (strCommand)
Do Until oExec.StdOut.atEndofStream
Wscript.Echo oExec.StdOut.Readline & " , " & Ucase(strComputer)
Loop