How to Do a Continuous Ping With NMAP

Written by brad malloy
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Do a Continuous Ping With NMAP
Nmap is a network monitoring tool that includes a ping tool. (John Foxx/Stockbyte/Getty Images)

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.

Skill level:

Things you need

  • Nmap software
  • Notepad
  • Windows PC

Show MoreHide


  1. 1

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

  2. 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. 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):


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


  4. 4

    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.

  5. 5

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

Tips and warnings

  • 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.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

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