tee.bat
@if (@X)==(@Y) @end /* Begin of JScript comment
::--- Batch section within JScript comment that calls the internal JScript ----
@echo off
cscript //E:JScript //nologo "%~f0" %*
exit /b
@if (@x)==(@y) @end End of JScript comment */
var mode=8; /*2: over-written, 8:append*/
var fso = new ActiveXObject("Scripting.FileSystemObject");
var file = fso.OpenTextFile(WScript.Arguments(0),mode,true);
var str;
while( !WScript.StdIn.AtEndOfStream ) {
str=WScript.StdIn.Read(1);
WScript.StdOut.Write(str);
file.Write(str);
}