Ping with Time Stamp
-
Hi Guys
Does anyone know how to ping 8.8.8.8 -t with a time and date stamp? I know how to get this to a txt file ie: C:>ping google.com >> c:\Test.txt -t but how can i get this to show the actual time and date? any ideas would be welcomed. thanks -
Ignore that - i found this batch file which works well:
@echo off
echo >pinglog.txt
for /f "tokens=" %%A in ('ping 127.0.0.1 -n 1 ') do (echo %%A>>pinglog.txt && GOTO Ping)
:Ping
for /f "tokens= skip=2" %%A in ('ping 127.0.0.1 -n 1 ') do (echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A>>pinglog.txt && GOTO Ping)##CASE CLOSED##