2013-11-01 123 views

回答

0
@echo off 

    rem start program 
    start calc.exe 

:loop 
    rem test internet connection 
    ping -n 1 www.google.com | find "TTL=" 
    if not errorlevel 1 goto loop 
    rem connection lost. kill. 
    taskkill /fi "imagename eq calc.exe" 
1
start calc 
:loop 
ping -n 1 google.com >nul && goto:loop || taskkill /im calc.exe 
相關問題