这个能直接得到最快的IP- @echo off
- cd.>test.txt
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in (a.txt) do (
- rem 下面的ping -n 1速度是最快的,如果想更精确一点改成ping -n 2或ping -n 3 .....
- for /f "tokens=3 delims=," %%b in ('ping -n 1 %%a^|find "Average"') do (
- set var=%%b
- set var=!var:Average=!
- set var=!var: =!
- set var=!var:ms=!
- >>test.txt echo %%a!var!
- ))
- for /f "tokens=2 delims==" %%c in (test.txt) do (
- set /a max=%%c
- for /f "tokens=2 delims==" %%d in (test.txt) do (
- set /a num=%%d
- if !num! gtr !max! (set max=!num!) else set max=!max!
- ))
- type test.txt|findstr /e "=!max!"
- del test.txt
- pause
复制代码
[ 本帖最后由 fastslz 于 2009-8-28 14:17 编辑 ] |