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

StackOverflow https://stackoverflow.com/questions/1652477

  •  22-07-2019
  •  | 
  •  

Question

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

Was it helpful?

Solution

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

OTHER TIPS

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top