oExec.StdOut after pipe Findstr

Discussion in 'Microsoft Windows 2000 CMD Promt' started by Wensi Peng, Jan 7, 2005.

  1. Wensi Peng

    Wensi Peng Guest

    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 Peng, Jan 7, 2005
    #1
    1. Advertisements

  2. Wensi Peng wrote:
    > 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.

    --
    Gruesse Greetings Saludos Saluti Salutations
    Matthias
    ---------+---------+---------+---------+---------+---------+---------+
     
    Matthias Tacke, Jan 7, 2005
    #2
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. MordacNM

    Re: Findstr problem within batch

    MordacNM, Jul 29, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    5
    Views:
    9,565
    M Ward
    Jul 29, 2003
  2. Michel Gallant

    Findstr and multi-string AND searches

    Michel Gallant, Oct 12, 2003, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    12
    Views:
    15,981
    Michel Gallant
    Oct 14, 2003
  3. Jon Smith

    Findstr question

    Jon Smith, Mar 25, 2004, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    8
    Views:
    725
    Paul R. Sadowski
    Mar 25, 2004
  4. djc

    findstr, for, or other command to do this?

    djc, Apr 27, 2004, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    8
    Views:
    1,737
    Matthias Tacke
    Apr 28, 2004
  5. Alex Horan

    Extracting a sub-string from a FINDSTR command

    Alex Horan, Nov 1, 2004, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    4
    Views:
    10,305
    Matthias Tacke
    Nov 1, 2004
  6. djc

    findstr question

    djc, Dec 23, 2004, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    2
    Views:
    932
  7. cliff
    Replies:
    6
    Views:
    1,277
    Timo Salmi
    Sep 12, 2005
  8. jkwold

    findstr doesn't always find

    jkwold, Feb 26, 2007, in forum: Microsoft Windows 2000 CMD Promt
    Replies:
    6
    Views:
    1,194
    Jason Gurtz
    Mar 21, 2007
Loading...