5

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?

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Dani
  • 1,226
  • 1
  • 13
  • 20

2 Answers2

10

Either use one of many tee clones for Windows.

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

vartec
  • 6,217
  • 2
  • 33
  • 49
4

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.

pjz
  • 10,595
  • 1
  • 32
  • 40