Sign in with
Sign up | Sign in
Your question

Command Line Redirect to Program

Last response: in Windows XP
Share
Anonymous
June 14, 2005 11:05:04 AM

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
Anonymous
June 15, 2005 4:25:27 AM

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 %%*
!