oExec.StdOut after pipe Findstr

  • Thread starter Thread starter Wensi Peng
  • Start date Start date
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
 
Wensi said:
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?
Yes, try it.
If you get unexpected results or an error message come back again.
You don't expect us to test it for you, right?

I think Ray Constanzo pointed you here for batch question not for
vbscript ones.
 
Back
Top