- @echo off
- :: ------------------------ 设置 ------------------------
- set App="myexe.exe"
- set UrlList="mttxt.txt"
- set Output="_执行结果.txt"
- :: ------------------------ /设置 -----------------------
-
- :: 生成用于延时的 vbs
- >"%temp%\delay.vbs" echo WScript.sleep 3000
-
- :: 统计网址数量,以便查看执行进度
- set /a UrlNum = 0, n = 0
- for /f "usebackq" %%a in (%UrlList%) do set /a UrlNum += 1
-
- :: 读取网址列表文件
- for /f "usebackq delims=" %%a in (!UrlList!) do call :Sub "%%a"
-
- del "%temp%\delay.vbs"
- exit /b
-
- :Sub
- :: 显示进度
- set /a n += 1
- title %n%/%UrlNum%
- echo %1
-
- :: 处理网址,并延时
- start "" /b %App% %1 > "%temp%\result.tmp"
- "%temp%\delay.vbs"
-
- :: 如果等待 3 秒后,要强制结束%App%进程,请去掉下一行前面的冒号
- :: for %%a in (%App%) do taskkill /f /im "%%~nxa" >nul 2>nul
-
- :: 读取执行结果
- set Result=
- set /p Result=<"%temp%\result.tmp"
-
- :: 判断执行结果
- >>%Output% (
- if not defined Result (
- echo 404
- ) else (
- if "%Result:powered by =%" neq "%Result%" (
- echo %Result:*powered by =%bbs
- ) else (
- echo unknow
- )
- )
- )
- goto :eof
复制代码
[ 本帖最后由 a6c123 于 2010-8-11 15:41 编辑 ] |