Script to ping and output results to text file

Reading Time: < 1 minute

Save the below script to a text file, amend the domain or ip you wish to ping and save as a .bat file. For example ping.bat

Open a command prompt and drop the ping.bat file into the command prompt and press enter.

The script will run and save output to c:\pingtest.txt
@Echo off

:TOP

echo %time% >> “C:\pingtest.txt”

Ping www.domainname.co.uk >> “C:\pingtest.txt”

GOTO TOP

Please follow and like us:

One thought on “Script to ping and output results to text file

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.