看了楼主在cndos也发了个帖子,也大概了解了一些。但还有一个问题不理解,就是每次dig后会产生几个query time,楼主需要的是哪个。按照楼主的意思,dig一次结果是没有意义的,所以需要dig多次,我写了一个代码,只取每次dig后的第一个query time,可以dig多次,次数自己设定,默认10次。- @echo off&setlocal enabledelayedexpansion
- cd.>result.txt
- for /f "tokens=2 delims=." %%i in (www.txt) do (
- for /f "delims=" %%j in (dnsip.txt) do (
- set /p= %%j(%%i^) <nul>>result.txt
- )
- )
- echo.>>result.txt
- for /l %%a in (1 1 10) do (
- cls
- echo 正在执行第 %%a 次
- set /p=%%a <nul>>result.txt
- for /f %%i in (www.txt) do (
- for /f %%j in (dnsip.txt) do (
- for /f "tokens=3 delims=:" %%k in ('dig %%j %%i^|findstr /n ".*"^|findstr "14:"') do (
- set /p=%%k <nul>>result.txt
- )
- )
- )
- echo.>>result.txt
- )
- echo.&echo 执行完毕!
- pause>nul
复制代码
|