目的:通过连续ping 一组主机,然后从PING返回结果中记录下网络丢包的时间和PING 值廷时超过200的发生时间
文件HOSTIP.txt内容:
qq.com
114la.com
hao123.com
192.168.0.254
文件pingtest.cmd内容:
setlocal EnableDelayedExpansion
@mode con cols=80 lines=25
@color 0b
@echo off
:loop
set ip=qq.com
set ip2=114la.com
set ip3=hao123.com
call :sping %ip%
call :sping %ip2%
call :sping %ip3%
goto loop
:sping
title 检测到 %1 连接信息
echo.=========================================================================
ping -n 1 %1 |find /i "TTL"
if %errorlevel% == 0 (echo.在【%date% %time%】时测试到 %1 网络是连通的) else (
echo. 在【%date% %time%】时测试到 %1 网络不通>>lost.log)
Last edited by senffon on 2010-5-9 at 13:41 ]