@echo off
title 检测是否掉包
set /p ip=请输入要扫描IP:
:eof
for /f "skip=8 tokens=3 delims=," %%i in ('ping /n 1 /w 1000 %ip%') do call :doit %%i
echo 连接%ip%不成功网络丢包 %time:~0,8%
:doit
if "%1"=="Average" echo 连接%ip%成功,网络延迟%2 %time:~0,8%
goto eof
运行到一段时间自动关闭p处理显示:
****b a e c h r e c u r s i o n exceeds stack limits*****
recursion count=598, stack usage=90 percent
****b a t c h processing is a b o r t e d ****