- @if (0)==(0) echo off
- dir /b *.txt | cscript //nologo //e:jscript "%~f0"
- pause & exit
- @end
-
- var getContent = function(strFile){
- var strName = fso.GetBaseName(strFile);
- var objFile = fso.OpenTextFile(strFile, 1);
- var s = objFile.ReadAll().replace(/[^\r\n]+/g, strName + ' $&');
- objFile.Close();
- fso.OpenTextFile(strName + '.Log', 2, true).Write(s)
- }
-
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- while(!WSH.StdIn.AtEndOfStream){getContent(WSH.StdIn.ReadLine());}
复制代码
|