How do I find, which process is listening on a specific port on the Windows operating system?

Advertisement

This article will help you to find the process name listening on a specific port on a Windows system. Sometimes you may have faced issues like “port in use” during application installation.

You can choose one of the below given 2 methods. The first method uses netstat to find the PID of the process listening on a specific port, then use tasklist to find the process name by the PID.

Method 1. Using Default Command Prompt

Use the following command to find out the process id (PID) listening on port 80. You can change this port to search for another port.

netstat -aon | findstr ":80" | findstr "LISTENING" 
Output:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4 TCP [::]:80 [::]:0 LISTENING 4

The last column of the output shows the PID of the processes. The above output shows the PID is 4 for the process listening on port 80.

Use this process id with the task list command to find the process name.

tasklist /fi "pid eq 4" 

You will see the process name in the results.

Finding the process listening on specific port in Windows

Method 2. Using Get-Process in PowerShell

The second method uses the PowerShell command to find out the process running on a specific port on Windows.

Launch the PowerShell terminal and execute the following command to find the process name running on port 80. You can change the port number to check for other ports.

Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess 

You will see the process name in the results.

Checking the process name running on specific port

Conclusion

In this tutorial, you have learned two methods to find process name listening on a specific port on a Windows system.

Share.

1 Comment

Leave A Reply