bug已修正:
- @echo off&&setlocal enabledelayedexpansion
- %1 start /min "" %0 ::&&exit
- for %%a in (sina.com online.cq 163.com) do (
- set /a c+=1,test=0
- set lost=
- for /f "skip=6 tokens=10 delims=ms()%% " %%b in ('ping /w 200 www.%%a^|findstr /n .') do (
- set /a test+=1
- if not defined lost set lost=%%b
- set n=%%b
- )
- if "!test!"=="2" (
- set /a p+=n*10,m=p/c
- ) else set /a lost=100,n=0
- set /a q+=lost*10,l=q/c
- )
- if %l% leq 9 set l=0%l%
- if "%m:~0,-1%"=="" set m=0%m%
- (echo Lost = %l:~0,-1%.%l:~-1%%%
- echo Average = %m:~0,-1%.%m:~-1%ms)>C:\ping.txt
复制代码
[ 本帖最后由 zm900612 于 2011-2-11 23:00 编辑 ] |