我运行此程序
@echo off
setlocal enabledelayedexpansion
set repeatNum=3
set repeatCount=0
set adslUser=05728086325
set adslPass=123456
set adslName=宽带连接
set total=102
:loop
set val=1
for /f "delims=" %%i in (c:\url.txt) do (
echo.
ping 127.1 -n 3 >nul 2>&1
set /a var+=1
echo 计数%total%次暂停3分钟并关闭TheWorld.exe,当前计数!var!
echo.
if !var! geq %total% (
ping 127.1 -n 110 >nul 2>&1
set var=0
taskkill /im TheWorld.exe /f >nul
) else (
echo %%i
echo.
start %%i
)
)
set /a repeatCount+=1
if !repeatCount! lss %repeatNum% (
rasdial "%adslName%" /disconnect
rem 请根据自己的网络情况自行调节延时的长短以确保能够能够获得新的IP
ping -n 10 127.1 >nul
rasdial "%adslName%" %adslUser% %adslPass%
goto :loop
)
pause>nul
"
可是经常会中途中断,提示说:"连接到系统上的设备没有发挥作用"
------解决方案--------------------------------------------------------
是不是设置的重新连接的时间过短?
------解决方案--------------------------------------------------------
把@echo off删掉,看看报错之前,代码在做什么事情。