aloha20200628 当前离线
上尉
@echo off setlocal enabledelayedexpansion ::设置尝试次数 set "imax=5" :top set/a "i+=1, k=0" for /f "delims=" %%v in ('ping -n 1 www.baidu.com ^|find /i "TTL" ') do ( set "k=1" &(echo,%%v !i!) ) if !k! equ 0 (echo,!i! 网络不通) if !i! geq !imax! (endlocal&exit/b) goto top复制代码
TOP
77七 当前在线
中校
wh123wh123 当前离线
六级士官
@echo off setlocal enabledelayedexpansion ::设置尝试次数 set "imax=500" :top set/a "i+=1, k=0" for /f "delims=" %%v in ('ping -n 1 www.baidu.com ^|find /i "TTL" ') do ( set "k=1" &(echo,%%v !i!) ) if !k! equ 0 (echo,!i! 网络不通) if !i! geq !imax! (endlocal&exit/b) goto top复制代码