Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

Reconstruct your command like so:

abc.exe >res.dat 2>&1

This will send STDERR to the same location.

share|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
1  
@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
add comment
abc.exe 1>2> res.dat

also works.

share|improve this answer
add comment

Your Answer

 
discard

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.