How to Write a Script to Ping Every 5 Minutes

By Mickey Walburg

The ping command sends several small packets of information from your computer to the designated target in an effort to determine if the target computer is online or offline. A normal ping command runs every second, but if you want to make a custom script to ping a target every five minutes, you can do so by creating a batch file.

Step 1

Open Notepad, WordPad or your favorite text editor.

Step 2

Create a new file and save it on your computer with the ".bat" file extension, which is a batch file script.

Step 3

Type the following four commands into the text file, each on a separate line, in order::beginping server_to_pingsleep 300goto :begin

Step 4

Save the batch file and then double-click on it. The ping command runs, pinging the "server_to_ping" every 300 seconds. Be sure to substitute the server IP address or name in the script for the "server_to_ping" example before you run the script.

References & Resources