Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to run two programs simultaneously from a batch file, and redirect the first program's output into a text file like:

start python arg1 arg2 > out.txt
start 2nd.exe %1 arg2 arg3

While the programs run as expected, all output is shown on stdout.

share|improve this question
This ought to work. Without knowing anything, I wonder if is doing something funny with output. – zpletan Sep 21 '11 at 17:17
No, but it writes to stderr. – none Sep 21 '11 at 17:25
That's why—> only redirects stdout (I think). In any case, it looks like you already have what you need. – zpletan Sep 21 '11 at 20:51
up vote 14 down vote accepted

You might need to do it this way:

start cmd /c python arg1 arg2 ^> out.txt
share|improve this answer
Thank you, but it does not work for me (out.txt is not even created in the local directory) – none Sep 21 '11 at 17:52
I tested it with CScript and a VBscript, so the idea is sound. Are you doing something "extra" in your command line that's not listed here, like double quotes? – Patrick S. Sep 21 '11 at 18:19
Sorry, something went awfully wrong - it works! – none Sep 21 '11 at 18:27

Redirection is applied to the start command, but somehow not to the cmd.exe instance it runs.

If the > operator is escaped, everything should work:

start arg1 arg2 ^> out.txt

(If you want to redirect stderr as well, use 2^> for it.)

share|improve this answer
Thank you, but it does not work for me. – none Sep 21 '11 at 17:52

Additionally, if you want to redirect both stderr and stdout this works for me

start call delay.bat ^1^> log.txt ^2^>^&^1

It seems every character basically needs to be escaped. This command normally looks like this:

delay.bat 1> log.txt 2>&1

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.