Click on Pictures to View

To view a larger version of an image within a post, just click on the picture you want to view :)
Showing posts with label ping -t. Show all posts
Showing posts with label ping -t. Show all posts

Thursday, July 14, 2016

Command for Timestamped Ping

Thought I'd post this since it has come in handy several times.  Just save the command to a text file for later, and cut and paste the command to a cmd prompt when needed and voila.  No 3rd party software needed, etc.

This command will give you a timestamped continuous ping:

ping -t 8.8.8.8|cmd /q /v /c "(pause&pause)>nul & for /l %a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 8.8.8.8>nul"

You can replace the two 8.8.8.8 addresses with whatever IP address you are trying to ping




Press Ctrl + C to end the ping

You can also send the output directly to a text file.
This command sends output of ping to 8.8.8.8 to C:\pingtest.txt


ping -t 8.8.8.8|cmd /q /v /c "(pause&pause)>nul & for /l %a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 8.8.8.8>nul" >C:\pingtest.txt

You can replace the two 8.8.8.8 addresses with whatever IP address you are trying to ping, and C:\pingtest.txt with whatever location and file name you want to send the output to.

Don't forget to press Ctrl + C in the command window to end the ping




Sources:

https://www.raymond.cc/blog/timestamp-ping-with-hrping/