本帖最后由 sbjugt 于 2014-3-18 15:51 编辑
- echo off
- set/a m=1
- :begin
- set/a n=%m%-1
- if "%n%"=="0" (set "skip=") else (set "skip=skip=%n%")
- for /f "%skip% tokens=* delims=" %%i in (ip.txt) do (
- set a=%%i&&goto:a)
- :a
- echo 当前检测IP为:%a%
- ping %a%>123.txt
- for /f "tokens=4 delims=^=" %%i in ('find /n "平均" 123.txt') do (set b=%%i)
- for /f "tokens=6 delims=^= " %%i in ('find /n "丢失" 123.txt') do (set c=%%i)
- if "%c%" == "4" echo %a% 网络断100^%% timeout>>pinRecord.txt
- if "%c%" == "3" echo %a% 网络通25^%% %b%>>pinRecord.txt
- if "%c%" == "2" echo %a% 网络通50^%% %b%>>pinRecord.txt
- if "%c%" == "1" echo %a% 网络通75^%% %b%>>pinRecord.txt
- if "%c%" == "0" echo %a% 网络通100^%% %b%>>pinRecord.txt
- set /a m=%m%+1
- goto begin
复制代码 我在WIN7下测试的 你可以更改“平均”和“丢失”为英文 |