Ping Multiple Hosts Using Windows Command Prompt

Published by Torry Crass on

Here's a quick method to check a list of servers (please keep in mind if you use names, they must resolve correctly for this to work).

First, put all of your server names into a file with each server name on a separate line.  Let's call it "servers.txt" and save it to your desktop.

Next, open up a Command Prompt in Windows and navigate to your desktop inside the command prompt so you can have direct access to the list you just created.

Now, enter the following line on the command prompt:

for /f "tokens=1" %a in (servers.txt) DO @ping -n 1 %a

This will attempt to ping every system in the list and return the result.  You can also modify the ping command at the end of the command above as needed with options pertaining to ping.

Happy pinging!


0 Comments

Leave a Reply