Use Netstat to See Listening Ports and PID in Windows
To get started, open the command prompt by clicking on Start and then typing cmd. In the command window, go ahead and type in the following command:
You can see the port being used in the second column called Local Address. You’ll see the port number after the colon. You’ll also see some ports and some PIDs listed more than once. That’s because one process can be using the same port number on different protocols like TCP, UDP, etc.
Now to see the name of the process that is using that port, go to Task Manager by pressing CTRL + SHIFT + ESC and then click on the Process tab. By default, the task manager does not display the process ID, so you have to click on View and then Select Columns.
Go ahead and check the box for PID (Process Identifier) and then click OK.
Now you should also see the PID alongside the process name in task manager. You can click on the column header to quickly sort the list by PID, thereby making it easy to find the process you are looking for.
And that’s about it! Hopefully this will help you find out which process is listening on what ports in Windows.
netstat -a -n -o
In the command above, the -o parameter is what will add the PID to the end of the table. Press enter and you should see something like this:
You can see the port being used in the second column called Local Address. You’ll see the port number after the colon. You’ll also see some ports and some PIDs listed more than once. That’s because one process can be using the same port number on different protocols like TCP, UDP, etc.
Now to see the name of the process that is using that port, go to Task Manager by pressing CTRL + SHIFT + ESC and then click on the Process tab. By default, the task manager does not display the process ID, so you have to click on View and then Select Columns.
Go ahead and check the box for PID (Process Identifier) and then click OK.
Now you should also see the PID alongside the process name in task manager. You can click on the column header to quickly sort the list by PID, thereby making it easy to find the process you are looking for.
And that’s about it! Hopefully this will help you find out which process is listening on what ports in Windows.
No comments