How do I find out, which process is listening on a specific port on Windows operating system?
This article will help you to find the process name listening on specific port on Windows system. Sometime you may have faced issue like “port in use” during application installation.
You can choose one of the below given 2 methods. First method uses netstat to find pid of the process listening on specific port, then use tasklist to find process name by the pid.
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.
c:\> 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 task list command to find the process name.
c:\> tasklist /fi "pid eq 4"
You will see the process name in results.
2. Using PowerShell Get-Process
The second method uses PowerShell command to find out process running on specific port on Windows.
Launch the PowerShell terminal and execute following command to find process name running on port 80. You can change port number to check for other ports.
c:\> Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess
You will see the process name in results.
Conclusion
In this tutorial, you have learned two methods to find process name listening on specific port on Windows system.
1 Comment
Thanks for sharing informative content!