Output Redirect problem by start command

H

Helen

Hello,

Is there anyone know what's wrong of the following
batch file:
start abc p1 p2 >> log_1.log
start abc p2 p3 >> log_2.log

I found that the abc program with different parameters
can be ran in seperate command prompt, however, the output
cannot redirect to the corresponding file.

best regards,
Helen
 
R

Ritchie

Helen said:
Is there anyone know what's wrong of the following
batch file:
start abc p1 p2 >> log_1.log
start abc p2 p3 >> log_2.log

There's nothing syntactically wrong with the above commands. What's
happening is that the stdout from the START command is being redirected
to the log files. Since the START command when used as above doesn't
actually output anything, you end up with a couple of empty files.

What you need to do is instruct a new instance of cmd.exe to execute your
program and redirect its output, something like this:-

start cmd /c "abc p1 p2 >> log_1.log"
 
H

Helen

Thanks a lot, Ritchie.
-----Original Message-----


There's nothing syntactically wrong with the above commands. What's
happening is that the stdout from the START command is being redirected
to the log files. Since the START command when used as above doesn't
actually output anything, you end up with a couple of empty files.

What you need to do is instruct a new instance of cmd.exe to execute your
program and redirect its output, something like this:-

start cmd /c "abc p1 p2 >> log_1.log"

--
Ritchie


.
 

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

Top