@echo off
echo 统计结果如下:>a.txt
set "com=ping -n 10 -l 512 -w 500 %%a^|findstr /i "lost average""
for /f "delims=" %%a in (ip.txt) do (
echo 正在ping【%%a】,请稍候...
setlocal enabledelayedexpansion
for /f "tokens=4 delims==" %%i in ('%com%') do (
set "b=!a!"
set "a=%%i"
)
echo IP地址:%%a--平均延迟时间:!a!--掉包率:!b!>>a.txt
endlocal
)
start a.txt