SEARCH

How-To Geek

How Can I Tell What is Listening on a TCP/IP Port in Windows?

Whenever an application wants to make itself accessible over the network, it claims a TCP/IP port, which means that port can’t be used by anything else. So if you need to use an in-use port, how do you tell what application is holding it?

There’s a number of ways to tell what application has the port locked, but we’ll walk through the built-in way using the command line and Task Manager, and then a great freeware application that does it all in one utility.

Use Built-In Tools to See What is Listening on a Port

The first step is to use a command-line tool to see what ports are in use, and use a special flag that tells us which port is assigned to each Windows process identifier number. Then we can use that number to look up exactly which process it is.

Open up a command prompt and type in the following—you may have to open in Administrator mode to see all processes:

netstat -aon | more

If you look on the right-hand side, you’ll see where I’ve highlighted the list of PIDs, or Process Identifiers. Find the one that’s bound to the port that you’re trying to troubleshoot—for this example, you’ll see that 0.0.0.0:80, or port 80, is in use by PID 4708.

image

Now you can simply open up Task Manager—you might have to use the option to Show Processes for All Users, and then you’ll be able to find the PID in the list. Once you’re there, you can use the End Process, Open File Location, or Go to Service(s) options to control the process or stop it.

image

Use CurrPorts to View What is Listening

If you aren’t really the command-line type, or you’d rather just use a simple utility to do it all in one step, you can use the excellent freeware CurrPorts utility by NirSoft, one of our favorite freeware authors.

Just open up the utility, and you can see everything—processes, ports, remote ports, the full path to the process.

image

If you double-click on any of the items, you’ll see every single detail.

image

You can also use CurrPorts to directly kill the process if you want.

Download CurrPorts from nirsoft.net

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 09/14/10

Comments (4)

  1. akash

    add the -t switch to get netstat to refresh every X seconds

  2. bum32

    Thanks for the tip, very useful.

  3. Angel

    netstat has a -b tab that show you the name of the executable.

  4. Thanks Angel

    Thanks Angel. The first thing I thought when I tried this was “It’d be better if it would list the executable.”
    I wish I would have known this a year ago. I found some third party port scanner try to figure out what port this app needed open to work properly. I spent most of the time finding a decent port scanner and there was one buiilt in the whole time. :)

Enter Your Email Here to Get Access for Free:

Go check your email!