How to Ping a Range of IP Addresses

Written by kevin lee
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Ping a Range of IP Addresses
(Comstock Images/Comstock/Getty Images)

Windows batch files save you time by automating repetitive processes. A batch program is nothing more than a file containing Windows commands. One useful command checks the status of remote computers. The computers may reside on a network or on the Internet. Users ping the IP addresses of remote computers using the ping command. Automate this process and ping a range of IP addresses by creating a simple batch file program.

Skill level:
Easy

Other People Are Reading

Instructions

  1. 1

    Open Notepad and create a new document.

  2. 2

    Type a range of IP addresses that you want to check. Place each IP address on a separate line. For example, your list might look like this:

    191.111.222.30

    191.210.333.41

  3. 3

    Click "File" and select "Save As" to open the "Save As" window.

  4. 4

    Type a name for the document, such as "myIPs" and click "Save." Notepad will save the document as a text file.

  5. 5

    Click "File" and select "New." Notepad will create a new, empty document.

  6. 6

    Add the following text to the document:

    For /f %%v in (c:\sourceFolder\sourceFile.txt) do ping %%v

    Replace "sourceFolder" with the name of the folder where you saved the text file containing the IP addresses. Replace "sourceFile.txt" with the name of that text file.

  7. 7

    Click "File" and select "Save As" to open the "Save As" window.

  8. 8

    Enter "xyz.bat" in the "File Name" text box. Replace "xyz" with any descriptive name. For example, you might name the file, "PingRange.bat." Click "Save." Windows will save the document as a batch file.

  9. 9

    Open Windows Explorer and locate the batch file that you saved. Double-click it. Windows will execute the code in the batch file and ping the range of IP addresses listed in the text file. View the results in the "Command" window that appears.

Tips and warnings

  • To save the results to a text file, change the code in the batch file to "For /f %%v in (c:\sourceFile.txt) do ping %%v >> results.txt". Replace "results.txt" with any name. Ping results will go to that file instead of the "Command" window. View this file in Notepad or any word processor.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.