oExec.StdOut after pipe Findstr


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
 
Ad

Advertisements

M

Matthias Tacke

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Findstr and Bmail 1
findstr 9
Findstr question 8
findstr question 2
Findstr, problem with $ anchor 4
Pipe the output 3
question about findstr 2
Pipes in for loop 1

Top