67,512
社区成员
发帖
与我相关
我的任务
分享
@echo off
for /f "delims=" %%i in (web.txt) do (
start /min "" "%programfiles%\Internet Explorer\iexplore.exe" "%%i"
for /l %%j in (1,-1,1) do (
cls
echo 倒计时 %%j 秒后打开下一个网页...
ping 127.1 -n 2 >nul
))
taskkill /f /t /im iexplore.exe
web.txt中数据有200条 电脑就反应不过来了!!! 还有没有其他方法解决
Option explicit
Dim fso,fread,str,strarry,linestr,ie,iexplorequit,x,y,i
Set iexplorequit=createobject("WScript.Shell")
'wscript.echo "开始执行"
'==================================判断进程是否存在start=============================
set y = getobject("winmgmts:\\.\root\cimv2")
set x = y.execquery("select * from win32_process where name='iexplore.exe'")
for each i in x
iexplorequit.Run "taskkill /f /t /im iexplore.exe",0 '结束现有iexplore进程
next
'==================================判断进程是否存在end=============================
wscript.sleep 5*1000 '延迟5秒
Set fso=createobject("scripting.filesystemobject")
Set fread=fso.opentextfile("web9001.txt",1)//在xp中可以运行、移到win7中 就报错 找不到文件
str=fread.readall
fread.close
If str="" then
'wscript.echo "file have not any content"
wscript.quit
End if
strarry=split(str,vbcrlf)
For Each linestr In strarry
'wscript.echo linestr '这里是用echo显示每一行的内容,你可以根据自己的需要做别的处理
set ie=createobject("internetexplorer.application")
'ie.visible=1
ie.navigate linestr
wscript.sleep 1*1000 '延迟1秒
'ie.quit
Next
wscript.sleep 5*1000 '延迟5秒
iexplorequit.Run "taskkill /f /t /im iexplore.exe",0 '结束所有iexplore进程
'wscript.echo "执行完毕"
wscript.quit
Set iexplorequit=Nothing
Set ie=Nothing
Set fso=Nothing