We Value Your Privacy

We and our partners use technology such as cookies on our site to personalise content and ads, provide social media features, and analyse our traffic. Click below to consent to the use of this technology across the web. You can change your mind and change your consent choices at anytime by returning to this site.

Update Consent
Loading ...

How to Do a Continuous Ping With NMAP

Updated July 20, 2017

Many people don't know about the most powerful automation tool their computers have built-in --- batch files. Using Nmap's ping capabilities inside a batch file is one great way to keep track of network connectivity. While Nmap has a Lua scripting engine included, writing a Lua script for continuous ping would be time-consuming and difficult. Whether you use Nmap in a business setting or at home, automation through batch files in Windows can make whatever you're doing easier.

Loading ...
  1. Download and install Nmap to the default location. This may require administrator privileges on a Windows operating system.

  2. Create a new text file with Notepad. You can do this by right-clicking on your desktop and selecting "New" and then "Text document," or by simply opening Notepad. This will be your batch file.

  3. Copy the following into your new text document, replacing [your target] with the address to ping. (Keep the quotes around the program and install directory the way they are):

  4. :TOP

  5. "C:\Program Files\Nmap\nmap.exe" -sn [your target]


  7. Save the document as whatever name you like, with the BAT file extension. This will let Windows know to run it like a program, rather than opening it in Notepad. On your desktop, it should have something like the name "nmap.bat" and have a different icon from a text file.

  8. Double-click the batch file. It should scroll text continuously, indicating that the ping is running.

  9. Tip

    To get results that are easier to read, add "-on log.txt --append-output" (without quotes) before your target location. This will add all the scrolling text to a file called log.txt.


    Continuous pinging can be considered malicious. Make sure you own any computer you plan on continuously pinging.

Loading ...

Things You'll Need

  • Nmap software
  • Notepad
  • Windows PC

About the Author

Brad Malloy is a professional writer whose work has appeared in his college newspaper, "Pipe Dream," and on a self-published blog reviewing computer components. Prior to writing, Malloy worked in information technology for two years and brings computer-networking, programming and gaming expertise to his online articles. He holds a Bachelor of Arts in English.

Loading ...