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


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

Ping >> “C:\pingtest.txt”