- @set @n=0;/* & echo off
- dir /b/s *.html | cscript -nologo -e:jscript "%~0"
- pause & exit /b & rem */
- fso = new ActiveXObject('Scripting.FileSystemObject');
- while (!WScript.StdIn.AtEndOfStream) {
- f = WScript.StdIn.ReadLine();
- txt = fso.OpenTextFile(f, 1).ReadAll();
- txt = txt.replace(/(.+=").+=(.{4,6})"/img,
- function(s0, s1, s2) {
- m = Math.floor(s2.length / 2);
- s = s1 + '\.\./\.\./htm/';
- s += s2.substr(0, m) + '/' + s2 + '\.html"';
- return s
- }
- );
- fso.OpenTextFile(f, 2, true).Write(txt);
- }
复制代码
|