How to check for used ports on Windows?
Using Command Prompt
- Netstat: This command displays active connections and listening ports.
- Open Command Prompt (you can search for
cmd
in the Start menu). - Type
netstat -ano
and press Enter. This will list all ports in use along with the process IDs (PIDs) using them. - To find a specific port, you can use
netstat -ano | findstr "PORT_NUMBER"
, replacingPORT_NUMBER
with the port you’re interested in.
- Open Command Prompt (you can search for
- TCPView: This is a graphical utility from Sysinternals that provides a more detailed view of TCP and UDP endpoints. You need to download it from Microsoft’s website.
Using PowerShell
- Open PowerShell (you can search for
powershell
in the Start menu). - Run the following command:
Get-NetTCPConnection | Where-Object { $_.LocalPort -eq PORT_NUMBER }
, replacingPORT_NUMBER
with the port you want to check. - Alternatively, you can use
Get-Process -Id (Get-NetTCPConnection -LocalPort PORT_NUMBER).OwningProcess
to get more information about the process that’s using the port.
Using Resource Monitor
- Open Resource Monitor, which can be found by searching in the Start menu or under the “Performance” tab of Task Manager.
- Go to the “Network” tab.
- Look at the “Listening Ports” section to see which ports are in use and by which processes.
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024