求带时间戳的ping代码或工具

时间:2022-02-16 03:52:59
在网上找了好多,运行时只是输出打印文本:
icrosoft (R) Windows Script Host Version 5.8
版权所有(C) Microsoft Corporation 1996-2001。保留所有权利。

不知是用错了,还是咋地,谢谢

这是参考的链接:
http://www.cnblogs.com/silentjesse/p/4638268.html

http://blog.csdn.net/windxxf/article/details/7864825

3 个解决方案

#1


仅供参考:pinglog.bat
title pinglog
:b
echo %date% %time% >>ping.log
ping -n 1 -w 20000 1.2.3.444 | find "TTL" >>ping.log
ping -n 1 -w 10000 1.2.3.444 | find "TTL"
if errorlevel 1 goto err
for /L %%i in (1,1,3) do echo delay %%is/30s & ping -n 1 -w 1000 1.1.1.1 >NUL
goto b
:err
echo %date% %time% >>tracert125.log
tracert -d -w 5000 1.2.3.444 >>tracert444.log
goto b

#2


引用 1 楼 zhao4zhong1 的回复:
仅供参考:pinglog.bat
title pinglog
:b
echo %date% %time% >>ping.log
ping -n 1 -w 20000 1.2.3.444 | find "TTL" >>ping.log
ping -n 1 -w 10000 1.2.3.444 | find "TTL"
if errorlevel 1 goto err
for /L %%i in (1,1,3) do echo delay %%is/30s & ping -n 1 -w 1000 1.1.1.1 >NUL
goto b
:err
echo %date% %time% >>tracert125.log
tracert -d -w 5000 1.2.3.444 >>tracert444.log
goto b

大哥,你哪儿好用不?

#3


参考我的博客代码   使用 ICMP 和 RAW Sockets实现 ping 类 

#1


仅供参考:pinglog.bat
title pinglog
:b
echo %date% %time% >>ping.log
ping -n 1 -w 20000 1.2.3.444 | find "TTL" >>ping.log
ping -n 1 -w 10000 1.2.3.444 | find "TTL"
if errorlevel 1 goto err
for /L %%i in (1,1,3) do echo delay %%is/30s & ping -n 1 -w 1000 1.1.1.1 >NUL
goto b
:err
echo %date% %time% >>tracert125.log
tracert -d -w 5000 1.2.3.444 >>tracert444.log
goto b

#2


引用 1 楼 zhao4zhong1 的回复:
仅供参考:pinglog.bat
title pinglog
:b
echo %date% %time% >>ping.log
ping -n 1 -w 20000 1.2.3.444 | find "TTL" >>ping.log
ping -n 1 -w 10000 1.2.3.444 | find "TTL"
if errorlevel 1 goto err
for /L %%i in (1,1,3) do echo delay %%is/30s & ping -n 1 -w 1000 1.1.1.1 >NUL
goto b
:err
echo %date% %time% >>tracert125.log
tracert -d -w 5000 1.2.3.444 >>tracert444.log
goto b

大哥,你哪儿好用不?

#3


参考我的博客代码   使用 ICMP 和 RAW Sockets实现 ping 类