Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

4 Answers 4

up vote 9 down vote accepted

Either use one of many tee clones for Windows.

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

share|improve this answer

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

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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