标题: [文本处理] 批处理如何实现超过5秒没反映跳到下一个? [打印本页]
作者: zahirll 时间: 2011-11-23 08:35 标题: 批处理如何实现超过5秒没反映跳到下一个?
- @echo off
- more +9 "%~f0" >GetUrlText.vbs
- type nul >2.txt
- for /f %%a in (1.txt) do (
- echo 正在检测:%%a
- cscript //nologo GetUrlText.vbs http://%%a/123.asp | findstr "<title>你好你好</title>" && >>2.txt echo,%%a
- )
- goto :eof
-
- strURL=WScript.Arguments(0)
- WScript.Echo strURL
- Set objXmlHttp = CreateObject("Microsoft.XMLHTTP")
- objXmlHttp.Open "GET",strURL,0
- objXmlHttp.Send()
- Set objStream = CreateObject("ADODB.Stream")
- objStream.Mode = 3
- objStream.Type = 1
- objStream.Open()
- objStream.Write(objXmlHttp.responsebody)
- objStream.Position = 0
- objStream.Type = 2
- objStream.Charset = "utf-8"
- strText = objStream.Readtext
- WScript.Echo strText
复制代码
可能有些站没反映,或者被卡死的,他就会卡在那不动了,想让他5秒钟没反映跳到下一个去检测
作者: awk 时间: 2011-11-24 23:26
cscript命令的/t选项可以设置超时吧
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |