Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a batch file written that runs a program we've developped, passing in a number of parameters. Whilst running the program in debug mode, a large number of debug messages are output, which it would be handy to review later, although I still want to be able to see the program running "live" as it were, within the cmd.exe window.

In a *nix environment I could use Tee to output to both the text file and stdout. Any suggestions?

share|improve this question
up vote 5 down vote accepted

TEE for Windows
TEE enables you to redirect standard output to a file and display it on screen simultaneously.

some_program | TEE [ /D:nn ] file_name

Available as BAT, Perl and Regina scripts.

Author's note.

The Rexx and Perl scripts will start displaying the result immediately. For the batch file, what it boils down to is, you may just as well redirect the command's output to a file and then display that file afterwards. As a bonus, that way you won't skip empty lines.

Note: These scripts were written just for fun. Even though the do work, they cannot compete with the "real" stuff -- compiled executables, written in "true" programming languages by true programmers.

I use Cygwin.
There is also Tee utility for Windows updated

share|improve this answer
Unfortunately Cygwin's not an option here. Works a treat though, and the zip includes a compiled executable as well. Perfect! – Edd Aug 25 '09 at 10:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .