标题: [求助]如何实现带时间的ping
[打印本页]
作者: wangff
时间: 2008-11-24 12:14
标题: [求助]如何实现带时间的ping
如何实现带时间的ping,且不改变原ping的所有功能,如-t的实时显示,最好以下格式:
11:50:01.00 Reply from 192.168.8.208: bytes=32 time<1ms TTL=127
作者: yishanju
时间: 2008-11-24 14:04
自己写一个ping 命令更好
哈哈
作者: wangff
时间: 2008-11-24 15:34
自已写了一个,但只有ping -t XXX 的不完全功能,我想应该有更好的方法
@echo off
set day=""
if not "%2"=="" (
echo.
echo 结果保存在:%2
echo.
)
if not "%1"=="" goto loop
echo Tping ip [filename]
echo 如: Tping 192.168.8.208
echo 如: Tping 192.168.8.208 abc.txt
pause>nul
goto end
:loop
if not %day%=="%DATE%" (
echo %DATE%
if not "%2"=="" (
echo.>>"%2"
echo %DATE%>>"%2"
)
set day="%DATE%"
)
ping %1 -n 1 | findstr "Reply Request Hardware unreachable find">temp.txt
set/p qq=%TIME% <nul
type temp.txt
if not "%2"=="" (
set/p qq=%TIME% <nul>>"%2"
type temp.txt>>"%2"
)
ping -n 2 127.1>nul
goto:loop
:end
作者: sncffihc
时间: 2008-11-27 11:49
标题: 虽然不完全相同,但差不多
@echo off
:PING
echo.|time | find "当" & PING/n 1 192.168.0.208 |FIND /I "Reply"
IF %errorlevel%==0 GOTO ping
ECHO
goto ping
作者: yishanju
时间: 2008-11-29 19:53
MTEE 可以完美实现楼主的要求
2008-11-29 19:24:55.140 Reply from 192.168.0.110: bytes=32 time<1ms TTL=128
2008-11-29 19:24:56.140 Reply from 192.168.0.110: bytes=32 time<1ms TTL=128
2008-11-29 19:24:57.937 Reply from 192.168.0.110: bytes=32 time<1ms TTL=128
2008-11-29 19:24:58.140 Reply from 192.168.0.110: bytes=32 time<1ms TTL=128
[
Last edited by yishanju on 2008-11-29 at 20:02 ]
作者: yishanju
时间: 2008-11-29 19:53
MTEE 下载
http://www.commandline.co.uk/mtee/index.html
作者: yishanju
时间: 2008-11-29 19:56
ping 192.168.0.110 -t|mtee /d /t
2008-11-29 19:26:46.703
2008-11-29 19:26:46.703 Pinging 192.168.0.110 with 32 bytes of data:
2008-11-29 19:26:46.703
2008-11-29 19:26:46.703 Reply from 192.168.0.110: bytes=32 time<1ms TTL=128
2008-11-29 19:26:47.671 Reply from 192.168.0.110: bytes=32 time<1ms TTL=128
2008-11-29 19:26:48.671 Reply from 192.168.0.110: bytes=32 time<1ms TTL=128
就是空行前面也显示时间
作者: qwertl
时间: 2008-11-30 16:35
MTEE 主要是做什么用的
作者: HAT
时间: 2008-11-30 17:36
标题: Re 8楼
http://www.cn-dos.net/forum/viewthread.php?tid=23054#pid161583