views:

1574

answers:

5

I would like to redirect the output from a command to a file and to stdout. I am using Windows XP command line.

I realize that there is a command in linux called tee which will do this, but I want this in windows.

+2  A: 

The simple DOS shell doesn't have the ability to do this simultaneously.
Try using:

Windows PowerShell

or

Cygwin

Jweede
+2  A: 

Use tee for windows.

jdigital
+3  A: 

The first hit when googling windows tee gives UNIX-style tee utility for Windows

JeffH
+1  A: 

PowerShell has tee-object (standard alias tee) if you are using a decent shell.

Richard
A: 

If using tee (one of the various Windows variants) isn't an option and the command isn't long-running or you don't need to do further processing of the output in real time, then

command > file && type file

would do that for you. But only under the mentioned circumstances. You're probably be better off using tee.

Joey