用法:
程序默认检查5个跃点,以及使用当前目录的ip.txt文件为ip数据库
你也可以指定跃点数以及ip数据库文件名
tip
tip 跃点数 ip数据库(tip 30 iplog.txt)
rem Build and Test by ALLyeSNO in WIN2K&WINXP
@echo off
cls
echo Build and Test by ALLyeSNO in WIN2K^&WINXP
echo.
echo 程序默认检查5个跃点,以及使用当前目录的ip.txt文件为ip数据库
echo 你也可以指定跃点数以及ip数据库文件名
echo use1:tip
echo use2:tip 跃点数 ip数据库(tip 30 iplog.txt)
echo.
set notimedout=0
set skip=0
set numberip=1
set notimedout=0
set numberline=0
if "%2"=="" set ipfile=ip.txt&&goto yd
set ipfile=%2
if not exist %ipfile% echo 没有找到%ipfile%文件,测试中止&&goto endx
:yd
if not exist ip.txt echo 没有找到ip.txt文件,测试中止&&goto endx
if "%1"=="" set yd=5&&goto gogogo
set yd=%1
:gogogo
for /f %%a in (%ipfile%) do set/a numberline=numberline+1
if "%numberline%"=="0" echo ip数据库内没有可用ip&&goto endx
:freexploit
if "%notimedout%"=="1" goto nexttest
set numbertracert=1
echo 目前正在检测1个ip
for /f %%a in (%ipfile%) do set tempip=%%a&&goto allyesno
:nexttest
if "%numberip%"=="%numberline%" echo.&echo 本次测试没有发现任何ip有timed out的情况出现&goto endx
set/a numberip=numberip+1
echo.
echo 目前正在检测第%numberip%个ip
set numbertracert=1
set/a skip=skip+1
for /f "skip=%skip%" %%a in (%ipfile%) do set tempip=%%a&&goto allyesno
:allyesno
echo 正在测试%tempip%的第%numbertracert%个跃点,请稍候
tracert -d -h %numbertracert% %tempip%|find "timed out"&&echo.>>rp.txt&&echo %date% %time%在检测%tempip%的第%numbertracert%个跃点时出现了timed out的情况>>rp.txt&&tracert -d -h %numbertracert% %tempip%|find "timed out">>rp.txt&&goto end
if "%yd%"=="1" goto end
if "%numbertracert%"=="%yd%" set notimedout=1&goto freexploit
set/a numbertracert=numbertracert+1
goto allyesno
:end
echo.
if not exist rp.txt echo 本次测试没有发现任何ip有timed out的情况出现&goto endx
type rp.txt
:endx
Tracert In The Bat (ALLyeSNO)
最新推荐文章于 2008-01-11 22:43:00 发布