On Linux with bash, I log both stdout and stderr out by following method
$> foo &> out.txt But, cmd on Windows does not support the method.
On Windows you can use following method
C:\> (foo.exe 2>&1) > out.txt"2>" means redirection from stderr(2). So, ">" equals "1>" and the '1' means stdout(1). If you want to log stdout and stderr to each file, you can use following command.
C:\> foo.exe > out.txt 2> err.txt