I need to capture all the messages from cmd.exe.

I tried abc.exe &> res.dat, but it doesn't seem to work with stderr or others. What should I do?

link|improve this question

74% accept rate
feedback

2 Answers

Reconstruct your command like so:

abc.exe >res.dat 2>&1

This will send STDERR to the same location.

link|improve this answer
OP wants to capture all output from cmd.exe not abc.exe -- I think the difference matters. – martineau Feb 24 '11 at 20:54
What other messages will cmd output when he is running abc.exe? ... – John T Feb 25 '11 at 1:46
Oh, I don't know, maybe 'abc.exe' is not recognized as an internal or external command, operable program or batch file. – martineau Jul 20 '11 at 14:48
@martineau, that string is part of standard error and will be captured by my command, but thanks for playing. – John T Jul 20 '11 at 18:24
feedback
abc.exe 1>2> res.dat

also works.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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