2011-04-06

How to redirect stdout and sterr to a file in Windows

compute.bat > compute.output 2>&1
"compute.bat" is the command we are executing.
"> compute.output" redirects the console output to a file called compute.output. If ">>" was used instead, the file would be appended.
"2>&1" redirects stderr (2) to where stdout (1) is directed

Reference: StackOverflow post

No comments: