Skip navigation

JSI Tip 7231. Netstat.exe from Windows NT 5.1, and greater, helps to determine which program uses or blocks a specific TCP port.


If you open a CMD prompt and type netstat -ano, you receive a display similar to:

Proto    Local Address    Foreign Address    State        PID
TCP      0.0.0.0:80       0.0.0.0:0          Listening    888
You can use Task Manger to match the PID (Process ID) to the program:

1. Start / Run / taskmgr / OK or press CTRL+ALT+DELETE and press Task Manager.

2. Select the Processes tab.

3. If the PID column is missing, press View / Select Columns, check the PID box, and press OK.

4. Press the PID column header to sort the processes by PID.

5. Match the PID from Netstat.exe to the PID in on the Processes tab to find the Image Name.

NOTE: When you type netstat /?, you receive:

Displays protocol statistics and current TCP/IP network connections.

NETSTAT \[-a\] \[-e\] \[-n\] \[-o\] \[-s\] \[-p proto\] \[-r\] \[interval\]

  -a            Displays all connections and listening ports.
  -e            Displays Ethernet statistics. This may be combined with the -s
                option.
  -n            Displays addresses and port numbers in numerical form.
  -o            Displays the owning process ID associated with each connection.
  -p proto      Shows connections for the protocol specified by proto; proto
                may be any of: TCP, UDP, TCPv6, or UDPv6.  If used with the -s
                option to display per-protocol statistics, proto may be any of:
                IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, or UDPv6.
  -r            Displays the routing table.
  -s            Displays per-protocol statistics.  By default, statistics are
                shown for IP, IPv6, ICMP, ICMPv6, TCP, TCPv6, UDP, and UDPv6;
                the -p option may be used to specify a subset of the default.
  interval      Redisplays selected statistics, pausing interval seconds
                between each display.  Press CTRL+C to stop redisplaying
                statistics.  If omitted, netstat will print the current
                configuration information once.



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish