本帖最后由 yhcfsr 于 2018-12-26 03:18 编辑
- @set @n=0/*&echo off
- set "TXT=test.txt"
- cscript -nologo -E:jscript "%~f0" "%TXT%" "%TEMP%"
- call "%temp%\ftmp.bat"
- del /f /q /a:h "%temp%\ftmp.bat"
- pause&exit */
-
- var file=WScript.Arguments(0);
- var temp=WScript.Arguments(1);
- var fso=new ActiveXObject('scripting.FileSystemObject');
- fo=fso.OpenTextFile(file);
- var result='';
- while(!fo.AtEndOfStream)
- {
- line=fo.ReadLine();
- if(line=='end') break;
- if(begin) result+=line+'\r\n';
- if(line=='begin') var begin=1;
- }
- fo.close();
- temp=temp+'/ftmp.bat';
- fo=fso.OpenTextFile(temp,2,true);
- fo.Write(result)
- fo.close();
- f = fso.GetFile(temp);
- f.attributes=2
复制代码
|