本帖最后由 pcl_test 于 2015-8-30 10:19 编辑
- @echo off
- set "dns=DNS服务器ip"
- set "adsl=宽带连接名"
- set "user=用户名"
- set "psw=密码"
- for /f %%a in ("A\A.exe") do set "Asize=%%~za"
- for /f %%b in ("B\A.exe") do set "Bsize=%%~zb"
- if "%Asize%" neq "%Bsize%" copy "B\A.exe" "A\A.exe" /y
- :loop
- set n=0
- ping -n 2 %dns% >nul&&goto :check
- :re
- rasdial "%adsl%" %user% %psw%&&goto :check||set /a n+=1
- if %n% leq 3 goto :re
- :check
- (tasklist|findstr /i "A.exe">nul)||(taskkill /f /im "C.exe"&start "" "A\A.exe")
- echo;计时15min,请稍后……
- ping -n 901 0 >nul&goto :loop
复制代码
|