原帖由 in2bat 于 2008-12-29 09:10 发表
楼上的是dig一次的结果,我想要的是dig 50次或者100次的平均值的结果。
加个for 怎么样 速度方面总要一次一次过啊
- @echo off&setlocal enabledelayedexpansion
- cd.>result.txt
- for /f "delims=" %%i in (dnsip.txt) do (
- if not defined str (
- set "str= %%i"&set /p=!str!<nul>result.txt)else (
- set /p= %%i<nul>>result.txt
- ))
- for /f %%i in (www.txt) do (
- echo.>>result.txt
- set "str=%%i "
- set /p=!str:~,25!<nul>>result.txt
- for /f %%j in (dnsip.txt) do (
- for /l %%a in (1 1 25) do (
- for /f "tokens=3 delims=:; " %%k in ('dig %%j %%i^|find "time"') do (
- set/a var+=%%k,n+=1
- )
- )
- set/a var/=n
- set "var=!var! msec "
- set /p=!var:~,20! <nul>>result.txt
- set "var="&set "n="
- )
- )
- pause
复制代码
|