| TEE.EXE (input goes to stdout as well as a file) |
A "T" (tee) program splits a pipe into 2 outputs, one goes to STDOUT as usual,
the other goes to a file.
For more information see
this wikipedia page
.
There are many versions of a popular tool like a "tee" program so it would be wise to take precausions and rename it to something else so use path on the executable to control where it gets picked up from.
dir | .\tee.exe "dir.listing.txt" 2>nul
Unlike most tee program the bundled one sends "c:\TMP\tee.exe: Reading stdin..." to "STDERR" so I redirected that to the "nul" device above.
See the LOGGING a Whole Scripts Execution to STDOUT and FILE example.
The following shows the syntax of the program installed along with this documentation... Other tee program names I have seen include "wtee.exe" and "wintee.exe".
| SYNTAX: TEE.EXE /? |
Send stdin or input file to stdout and a file.
TEE [/o [[Drive:]Path]filename] [/i [[Drive:]Path]filename]
TEE {new or overwrite output filename}
/a Output filename, append
/o Output filename, overwrite or new
/n Output filename, overwrite or new
/i Input filename
![]() | ![]() |