I have a command which I need to inspect in real time (i.e. see its output in the command prompt MyProgram.exe) and to have a log file for later inspection (MyProgram.exe > log.txt)



How can I make a single instance of the program to write to both outputs?

link|improve this question

50% accept rate
feedback

4 Answers

up vote 7 down vote accepted

Either use one of many tee clones for Windows.

Or if you're using PowerShell, you can use Tee-Object.

link|improve this answer
feedback

You want a unix tee clone like this one or this one. I'm sure there are others, but, well, your Google for 'windows tee' is as good as mine.

link|improve this answer
feedback

Thanks for the link! I also have a version available in Ruby that works on Windows.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.