schummi
schummi

Reputation: 15

Redirect stderr and stdout to one file and stderr to another using cmd

I want to start a program and redirect stdout and stderr in one file and stderr to another. I read a lot about using tee but this seems not to work for cmd.

This already works but I need stderr in a second file as well.

programm >> combined.log 2>&1

I have tried sth like this but it didnt work.

program >> combined.log 2>&1 2>> error.log

Upvotes: 1

Views: 40

Answers (1)

lit
lit

Reputation: 16226

It would be nice to have your cake and eat it too. That is not always possible. The stderr log can be captured, then appended to the combined log.

program >>combined.log 2>err.log
type err.log >>combined.log

Upvotes: 2

Related Questions