Tired of struggling with processes that won’t terminate on their own, jamming valuable ports, and causing critical services and applications to malfunction? Your search end here! In Windows 11, you can easily terminate these stubborn processes and free up ports by using various methods to kill processes on a port.
Your Windows 11 creates many ports virtually where internet connections start and end. Various software, services, and apps on your device use these ports to communicate with its online server on the developers’ end or any cloud databases. While in most cases these apps clear the ports when you close them, some apps keep the ports busy even after the service has been stopped. When you start another app that must use the same port, you either face delays in initialization or the app won’t start at all. Want to fix such awful moments? Keep reading!
Why Do You Need to Kill a Process on Port?
Sometimes, a software process running on a specific port may not terminate on its own, even after you’ve closed the associated application or service. This can happen due to reasons, like a bug in the software or service, a network trouble, or a conflict with another application.
To free up the port and allow other processes to use it, you may need to manually terminate the process that’s occupying it. This is where killing a process on a specific port comes in. By killing the process, you can release the port and allow other processes to use it.
How to Kill a Process on a Port on Windows 11
Here are the all reliable and proven methods to kill a process on a port on any Windows 11 PC. Also, you must know that the same methods would work on earlier Windows PCs like Win 10, Win 8.1, Win 7, etc.
Also read: How to See Logical Processor Usage in Task Manager
1. Kill Process on Port Using Command Prompt
- Click Start and type command to bring up the Command Prompt tool.
- Select the Run as administrator link to open the Command Prompt utility with elevated rights.
- Now, copy and paste this command inside the tool and hit Enter:
netstat -ano | findstr :<port_number>
- You must replace the <port_number> placeholder text with an actual port number that you want to clear.
- The above command should fetch the process ID (PID) for the process you want to kill.
- Once you’ve got the PID, run the following code on the same CMD window:
taskkill /F /PID <process_id>
- Hit Enter to forcefully terminate the target PID at the desired port on Windows 11.
- You must replace the <process_id> placeholder text with an actual PID retrieved by running the previous command.
2. Stop a Process on a Port Using Resource Monitor
Since the Windows Vista operating system, expert Windows PC users like developers and IT network engineers have been using the Resource Monitor utility to track Windows PC resource usage like CPU, RAM, HDD, SSD, Network, and so on.
Using the same tool, one can also track the port usage on a Windows PC. That’s not all! You can manage the usage, kill processes, clear ports, and more on the same utility. This is a built-in app on Windows PCs so you don’t need to get any third-party app. Find below how to use this method on your end:
- Hit the Windows + R keys together to bring up the Run tool.
- There, execute the following command to open the Resource Monitor app:
- On the Resource Monitor app, click the Network tab.
- Inside the Network tab, click the Listening Ports menu.
- There you go! All the ports, their protocols, PID, occupying apps, etc., are in front of you.
- The codes under the Image column of the Listening Ports menu are Task Manager processes.
- Open the Task Manager app by pressing Ctrl + Shift + Esc.
- Now, find the port you want to clear on Resource Manager.
- Also, look for the relevant app under the Image column.
- Then, find the task in Task Manager under the Processes column.
- Right-click the process and choose End task from the context menu that pops up.
That’s it! You’ve cleared the occupied port by ending the process linked to it from Task Manager.
3. Kill a Process on Port Using PowerShell
If you like to automate Windows 11 tasks using PowerShell, then you’ll also want to know how to kill a process on a port using this powerful command line tool of a Windows PC. Then, you can implement the codes in your existing automation to fully automate the port-killing process. Find below the PowerShell commands and how they work on a Windows 11 PC:
- Open PowerShell with elevated rights. For this, you can search Power in the Start menu and click Run as administrator.
- Then, copy and paste the following cmdlet on the PowerShell terminal:
Get-Process -Id (Get-NetTCPConnection -LocalPort <port_number>).OwningProcess
- On the above cmdlet, you must replace the <port_number> placeholder text with an actual port that you want to be cleared off the existing process.
- Now that you’ve got the PID you need, you’re ready to run the command that kills a port on PowerShell. Here’s the script:
Stop-Process -Id <process_id> -Force
- Don’t forget to replace the <process_id> text with an actual PID. Now, hit the Enter key to execute the code.
4. Kill a Process on Port Using Microsoft Apps
You can use the following Microsoft Sysinternals system apps to find engaged ports, and linked processes, and stop them conveniently with a few clicks:
For example, if you’re running the TCPView app, you need to try the following steps:
- Download the tool from the above web portal and open it.
- The downloaded folder might be compressed so you need a Zip or RAR tool to unzip it.
- Now, you can run the EXE files inside it like tcpview64.exe for a 64-bit Win 11 PC.
- Hit the Agree button and the app would show up.
- There, you can browse between TCP and UDP protocol ports.
- You can identify all the engaged ports and their processes right from the app interface.
- Pinpoint the port that you need to be cleared by clicking on it.
- Simply right-click on the selected port and choose Kill Process on the context menu.
Similarly, you can download and run the Process Explorer app. It shows the PID for all the processes and apps that use a port on your PC. So, you can use any of the codes on Method 1 or 3 to find a PID you need to kill. Then, right-click on the same PID on the Process Explorer app and hit the Kill Process option. This should clear the required port instantly.
Also read: How to Convert RAR File to ZIP in Windows
5. Kill Processes on Ports by Using the TCP/IP Reset Tool
If none of the above works for you, this is the ultimate method you can try out. This method resets all the open TCP and UDP com ports for networking. Thus, you can easily start the next application that would use a port previously used by a troubling program. Here’s how you can accomplish this:
- Open the Command Prompt utility with elevated rights.
- Now, run the following commands one by one:
netsh int ipv4 reset netsh int ipv6 reset netsh winsock reset
- When all the above commands have been run, execute the following command to check the status of the target port:
netstat -ano | findstr :<port_number>
- Don’t forget to replace the <port_number> text with an actual port number you want to monitor.
So, these are pretty much the most popular and common methods to kill a process on any port on a Windows 11 PC. You can give any of the above methods a try and share your experience below in the comment box. Also, if you know a better way, don’t hesitate to share that in your comment. Do share this article with your friends, colleagues, and followers to help them out when they face the same port-occupied error on Windows 11.
Did this help? Let us know!