Batch file for checking port status of multiple IP Address

11,155

You could use nmap http://nmap.org to script something to check and list whats open on a given host or set of hosts

TiZon is right though, wed need to know more about what youre wanting to do before we could give a more concise answer.... Are you checking more than one host, the same ones over and over, more than one port, etc?

Just a wild assumption... If you want a robust monitoring and alerting system you could look at nagios www.nagios.org its free and does a great job monitoring and alerting for things like open / closed ports

Share:
11,155

Related videos on Youtube

Varun V
Author by

Varun V

Updated on September 18, 2022

Comments

  • Varun V
    Varun V over 1 year

    How to check the port status of multiple IP Addresses from windows command prompt. I am looking for some Batch file or a Dos SCRIPT. Can anyone help on this?

    • APR
      APR over 12 years
      You could probably do this with PortQry. Do you always need to check the same ports? UDP/TCP/Both?
    • Varun V
      Varun V over 12 years
      PortQry is useful but how to make a batch script or portqry to read the host list from a txt file, exicute the command and send the result to -l log.txt file
    • Varun V
      Varun V over 12 years
      Thnx all for the support, My requirement got solved by using PortQry.
    • Varun V
      Varun V over 12 years
      i used the below in to the batch file.
    • Varun V
      Varun V over 12 years
      set protocol=TCP set port#=8080,4343,18443 for /f "tokens=1" %%V in (hs.txt) do portqry -n %%V -p %protocol% -o %port#%
  • Varun V
    Varun V over 12 years
    Yes i am trying to find the status of multiple ports like 8080,4343 on multiple IP addresses i.e list of systems in a txt file.
  • Varun V
    Varun V over 12 years
    i have to find the multiple port status for multiple IP address nearly about 400+ systems. I am looking for any simple batch script which can generate the status of port in to a log file.
  • gWaldo
    gWaldo over 12 years
    This can be accomplished via a for loop given a list of servers, and at the end of the telnet command, append ">> filename.log" to the end of the command so that it appends the output to a file of your choosing (creating the logfile if it doesn't exist.)