Command Line Redirect to Program

Archived from groups: microsoft.public.windowsxp.general (More info?)

I am looking for a command line command which will redirect the output of one
command into the input of the second program much like "|" but with a twist.
I want the second program to take in the passed parameters after the calling
program
Run program1.exe
Output: parameter1 parameter2
Now take these two parameters into program2.exe like this:
program2.exe parameter1 parameter2

This does not work: program1 | program2 because this would be like
program 1 (outputs parameter1 parameter2)
parameter1 parameter2 program.exe

Thanks for your help.
Jason Ryon
1 answer Last reply
More about command line redirect program
  1. Archived from groups: microsoft.public.windowsxp.general (More info?)

    "Jason Ryon" <JasonRyon@discussions.microsoft.com> wrote in message
    news:8C42C2A5-5B9B-45ED-9AB9-8832095F3B3D@microsoft.com...
    > I am looking for a command line command which will redirect the output of
    one
    > command into the input of the second program much like "|" but with a
    twist.
    > I want the second program to take in the passed parameters after the
    calling
    > program
    > Run program1.exe
    > Output: parameter1 parameter2
    > Now take these two parameters into program2.exe like this:
    > program2.exe parameter1 parameter2
    >
    > This does not work: program1 | program2 because this would be like
    > program 1 (outputs parameter1 parameter2)
    > parameter1 parameter2 program.exe
    >
    > Thanks for your help.
    > Jason Ryon

    Try this:

    @echo off
    for /F "tokens=*" %%* in ('FirstApp.exe') do SecondApp.exe %%*
Ask a new question

Read More

Command Line Microsoft Command Prompt Windows XP