Windows CMD Batch, START and output redirection
You might need to do it this way:
start cmd /c python 1st.py arg1 arg2 ^> out.txt
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 1st.py arg1 arg2 ^> out.txt
(If you want to redirect stderr as well, use 2^>
for it.)
What did the trick for me was moving the command into a separate batch file:
rem this first batch file triggers the second one:
start the_second.bat arg1 arg2 out.txt
the_second.bat then looks like this:
python 1st.py %1 %2 > %3