Output Redirect problem by start command

  • Thread starter Thread starter Helen
  • Start date Start date
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
 
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"
 
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


.
 
Back
Top