- @echo off
- setlocal enabledelayedexpansion&cls
- for /f "tokens=* usebackq delims=" %%a in ("IP_list.txt") do (
- echo ping %%a ......
- for /f "tokens=6 delims= = " %%A in ('ping %%a 2^>nul^|findstr /i "Average"') do (
- set _time=%%~nxA
- set _time=!_time:ms=!
- set _time=!_time:~,-1!
-
- if not defined min (set min=!_time!&set _IP=%%a)
- if !_time! lss !min! (set min=!_time!&set _IP=%%a)
- echo min=!min!
- echo.
- ))
-
- echo min=%min% IP=%_IP%
复制代码
|