Mtee is a commandline utility that sends any data it receives to the console and to any number of files. Useful if you want to watch and record the output from a batch file or program.
Mtee is an 11kb standalone executable. It does not create any temporary files or write to the registry. There is no installation procedure, just run it. To remove all traces of Mtee from your system, just delete it.
Mtee is simple to use and only has several options. To list them, type mtee/?
Version 2.1 is now open source software released under the MIT License,.
Credit to Jari Kulmala for addressing the following:-
The following features are new to Mtee v2.0
MTEE [/A | /U] [/C] [/D] [/T] [[/+] file] [...]
|/A||Convert output to ANSI. Default output is the same as input|
|/C||Continue if errors occur opening/writing to file (advanced users only)|
|/D||Prepends each line with local date in YYYY-MM-DD format (ISO-8601).|
|/T||Prepends each line with local time in HH:MM:SS.MSS format (ISO-8601).|
|/U||Convert output to Unicode. Default output is the same as input|
|/+||Append to existing file. If omitted, existing file is overwritten|
|file||File to receive the output. File is overwritten if /+ not specified|
|...||Any number of additional files. Use /+ before each file to append|
The parameters can be specified in any order. The only requirement is that the /+ switch, if used, must be followed by a filename.
View Mtee help screen:-
Send the output of script.cmd to the console and to RESULT.LOG. If RESULT.LOG already exists, it will be overwritten:-
Send the output of the automated ftp session to the console and to two log files, LOCAL.LOG is overwritten if it already exists. REMOTE.LOG is appended to if it exists, otherwise it is created:-
Make two copies of LOG whilst viewing LOG on the screen. If NEW1 and NEW2 already exist, they are overwritten:-
Redirect stdout and stderr from UPDATE.CMD to the console and appends to LOG.TXT. Each line is prefixed with local date and time:-
Send the output from BACKUP.CMD to the console and two remote log files. If there is an error opening any of the log files (server offline for instance) MTEE will continue. If the destination files already exist, they are appended to:-
Make multiple carbon copies of patch.exe:-
Make a unicode log of HFNETCHK:-
Display stdout on the console, and stderr on the console and also to a log file with each line of stderr prefixed with local date and time:-