Pinging 130.75.242.55 with 32 bytes of data:
Reply from 130.75.242.55: bytes=32 time<1ms TTL=123
Reply from 130.75.242.55: bytes=32 time<1ms TTL=123
Reply from 130.75.242.55: bytes=32 time<1ms TTL=123
有时我们希望加上时间标签,即能够反应某时间下ping 的情况。我们可以通过下面方法实现——
生成一个ping.bat 文件,文件内容如下:
set IP="xxx.xxx.xxx.xxx" //输入你要ping 的 IP 地址
:A
echo %date% %time% >> D:\%IP%.txt
ping %IP% | find "TTL" >> D:\%IP%.txt
GOTO:A
运行时,直接双击 ping.bat 即可!
运行效果如下:
2011-12-19 星期一 11:32:35.92
Reply from 130.75.7.156: bytes=32 time=106ms TTL=58
Reply from 130.75.7.156: bytes=32 time=444ms TTL=58
Reply from 130.75.7.156: bytes=32 time=8ms TTL=58
Reply from 130.75.7.156: bytes=32 time=71ms TTL=58
2011-12-19 星期一 11:32:39.09
Reply from 130.75.7.156: bytes=32 time=2ms TTL=58
Reply from 130.75.7.156: bytes=32 time=55ms TTL=58
Reply from 130.75.7.156: bytes=32 time=247ms TTL=58
Reply from 130.75.7.156: bytes=32 time=218ms TTL=58
2011-12-19 星期一 11:32:42.37
Reply from 130.75.7.156: bytes=32 time=132ms TTL=58
Reply from 130.75.7.156: bytes=32 time=331ms TTL=58
Reply from 130.75.7.156: bytes=32 time=15ms TTL=58
Reply from 130.75.7.156: bytes=32 time=152ms TTL=58
2011-12-19 星期一 11:32:45.62