I am attempting to monitor a connection to my terminal sever and am using the command:
ping -t terminalsvr -s 1 > c:\pingfile.txt to capture the ping results.
Here is a sample of what I receive:
Pinging terminalsvr [192.168.10.19] with 32 bytes of data:
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 1825398531
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 1154572035
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 752180995
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 349789955
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 4242300675
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 3839909635
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 3437518595
Reply from 192.168.10.19: bytes=32 time<10ms TTL=128
Timestamp: 192.168.10.19 : 3035127555
Ping statistics for 192.168.10.19:
Packets: Sent = 8, Received = 8, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Control-C
How is the timestamp read? Is there a way for me to have the timestamp appears as the actual time on the pc?
thanks all
@echo off
setlocal
call :TICK2TIME t 59818406
echo time: %t%
goto :EOF
:TICK2TIME
set /a _h=%~2 / 1440 / 60 / 60
set /a _m=(%~2 / 1440 / 60) %% 60
set /a _s=(%~2 / 1440) %% 60
call :ZEROPAD _h %_h%
call :ZEROPAD _m %_h%
call :ZEROPAD _s %_h%
set %1=%_h%:%_m%:%_s%
goto :EOF
:ZEROPAD
if /I %~2 LSS 10 set %~1=0%~2
goto :EOF
Good Luck,
Steve