Ping Equivalent For Checking If A Port Is Open

Solution 1:

You could use netcat if there is a Windows version - on Linux I use:

nc -z <host> <port>

This returns 0 if the port is open. Run this in a loop for make it continuous.

If Powershell is available, see https://web.archive.org/web/20111102182913/http://poshcode.org/85 for an example.

Solution 2:

Or use nmap from http://nmap.org , there is a windows version available.

nmap -p port host

or, for hosts not responding to ICMP requests,

nmap -P0 -p port host

Solution 3:

You could use nping from nmap like:

C:\>nping --tcp -p 80 192.168.1.1

where -p specifies the port to scan (here: 80). Furthermore you can use -H for hiding sent packets, in favor of showing only replies.