3

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?

2 Answers 2

4

Reconstruct your command like so:

abc.exe >res.dat 2>&1

This will send STDERR to the same location.

4
  • OP wants to capture all output from cmd.exe not abc.exe -- I think the difference matters.
    – martineau
    Feb 24, 2011 at 20:54
  • What other messages will cmd output when he is running abc.exe? ...
    – user1931
    Feb 25, 2011 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, 2011 at 14:48
  • 1
    @martineau, that string is part of standard error and will be captured by my command, but thanks for playing.
    – user1931
    Jul 20, 2011 at 18:24
2
abc.exe 1>2> res.dat

also works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .