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.
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND