qodeninja
qodeninja

Reputation: 11266

Using DOS/CMD/batch files how can you show Console output, and redirect the STDOUT and STDERR streams to files?

direct console to ok.log, and errors to error.log for example

Upvotes: 1

Views: 2674

Answers (3)

Jacob
Jacob

Reputation: 78850

OK, if your goal is to split output into both stdout and a file, take a look at this SO question.

Upvotes: 1

D.Shawley
D.Shawley

Reputation: 59563

The only way that I have found to do this is by using some variant of the UNIX tee command. You would use it like:

[your command] 2> error.log | tee ok.log

Upvotes: 1

Jacob
Jacob

Reputation: 78850

[your command] > ok.log 2> error.log

Upvotes: 2

Related Questions