不知道怎么用tracert怎么检测,所以把所有tracing的输出都显示出来了。地址文件格式为每行一个地址。
重新修改了一下,现在把ping的回显打开了,并把所有检查的数据都输出到ipLog.txt里。输出内容没做筛选,可能有点乱。有别的需要的话pm我就行。
- @echo off
- set "connection=DISCONNECTED"
- set "traceReq=false"
- title %date%
- :bof
- set /p myfile=[把地址文件拖到这里并按Enter]
- if not exist %myfile% goto bof
- echo.
- echo %date%%time%>ipLog.txt
- for /f "delims=" %%a in ('type %myfile%') do call :ipCheck %%a
- echo.
- echo 检测完成,按任意键退出!
- pause>nul
- exit
- :ipCheck
- title ^>^>^>Pinging [%~1]^<^<^<
- ping %~1>pingTemp
- type pingTemp | find /i "lost = 4" >nul 2>nul
- if /i {%errorlevel%}=={1} set "connection=connected" & set "traceReq=true"
- type pingTemp
- if {%traceReq%}=={false} goto finishCheck
- title [%~1 STATUS:%connection%] ^>^>^>Tracing...Please wait...^<^<^<
- tracert /d %~1>traceTemp
- more +4 traceTemp
- :finishCheck
- echo.
- type pingTemp>>ipLog.txt 2>nul
- type traceTemp>>ipLog.txt 2>nul
- echo ===============================================>>ipLog.txt
- echo.>>ipLog.txt
- echo ===============================================
- ::resetEverything
- title %date%
- set "traceReq=false"
- set "connection=DISCONNECTED"
- del pingTemp>nul 2>nul
- del traceTemp>nul 2>nul
- exit/b
复制代码
[ 本帖最后由 TX_kakashi 于 2010-8-9 13:58 编辑 ] |