Hopefully "ScriptingTipsAndTricks" helps you with your batch file or vbscript scripting :-)
[Bottom][Contents][Prev]: Net-SNMP (Collection of Open Source SNMP Tools (including SnmpSet.exe)[Next]: Batch Files
\->Useful Programs->TEE.EXE (input goes to stdout as well as a file)

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


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Net-SNMP (Collection of Open Source SNMP Tools (including SnmpSet.exe)[Next]: Batch Files


ScriptingTipsAndTricks© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday September 07 2014 at 12:50pm
Visit ScriptingTipsAndTricks's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.