qiwuqishangwu
qiwuqishangwu
2017-11-06 09:33

这个bat出现死循环了怎么处理?

  • 批处理

/*&cls
@echo off
rem 测试前先备份zip原文件
rem 指定WinRAR的安装路径
set "rarpath=C:\Program Files\WinRAR\WinRAR.exe"
for /f "delims=" %%a in ('dir /a-d/b *.zip *.rar') do (
echo;"%%a"
"%rarpath%" x -r -y -ibck "%%a" *.txt "%~dp0\$tmp\"
pushd "%~dp0\$tmp\"
dir /a-d/b/s *.txt|cscript -nologo -e:jscript "%~f0"
"%rarpath%" u -r -ibck "%~dp0%%~nxa." *.txt
popd
rd /q /s "%~dp0\$tmp\"
)

nul ping /n 3 0&exi
*/

var fso=new ActiveXObject('Scripting.FileSystemObject');
while(!WSH.StdIn.AtEndOfStream) {
var line = WSH.StdIn.ReadLine();
strReplace(line);
}

function strReplace(file){
try{
var f=fso.OpenTextFile(file, 1);
var txt=f.ReadAll();
f.Close();
//替换字符串
txt=txt.replace('小说下载', ' ');
txt=txt.replace('请手机用户输入', '');

  var f=fso.OpenTextFile(file, 2);
    f.Write(txt);
    f.Close();
}catch(e){}

}

这段代码在批处理时候无限循环 怎么也停不下来

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答