How To Find Port Number by Process ID (PID) on Windows

0

It’s a pretty straightforward scenario how you find the running process’s port number when you know the process ID. Let’s say you need to find more information about a running process, the place to go is obvious – Task Manager. But Task Manager doesn’t always have all the info you are looking for. We know that you can configure to display more info by going to View > Columns … to add additional columns on other areas of the system usage, BUT not for network port numbers. There is no option to select Port Number columns from Task Manager. Instead you can do that with the old fashion with command line prompt in Windows.

2015 07 21 0934 600x394 - How To Find Port Number by Process ID (PID) on Windows

If your Task Manager doesn’t have PID column showing up, this can be configured to display from View > Select Columns …

2015 07 22 1733 - How To Find Port Number by Process ID (PID) on Windows

Make sure PID (Process Identifier) are selected.

2015 07 22 1732 - How To Find Port Number by Process ID (PID) on Windows

Now given PID are present, you can launch command prompt by going to Start > Cmd

netstat -a -b -o

2015 07 21 0929 001 600x446 - How To Find Port Number by Process ID (PID) on Windows

This will list all the ports every process is listening and established. It’s going to take sometime for the command to finish, since it’s trying to return all the established connections that requires time for DNS to do reverse lookup. If you want to speed things up simply type

netstat -ano | findstr

This will display addresses and port numbers in numerical form, hence skip all the overhead. Replace <PID> to your own process ID without the <>. Ex. in my case I will use netstat -ano | findstr 18300

That’s it, a quick way to find the port number based on which process is running given you know the process ID.

Was this article Helpful?

Thank you for the feedback!

LEAVE A REPLY

Please enter your comment!
Please enter your name here