To list service processes ID (PID) In PowerShell terminal run
Get-NetTCPConnection -LocalPort 80
# or
netstat -aon | findstr ":80"
To get the name of the service along with some other informations, run:
Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess
or
Get-Process -Id ((netstat -aon | findstr "]:80") | %{$_.Split()[-1]})
findstr
– filters the rows to those containing a given string
%{$_.Split()[-1]}
– grabs last column only
How to kill the process using PID with CLI on Windows
Kill all processes running at port 80
taskkill /PID ((netstat -aon | findstr "]:80") | %{$_.Split()[-1]}) /F
Search and kill PID id by process name
taskkill /PID ((ps | findstr "notepad") | %{$_.Split()[-5]}) /F
* Note that you need to replace "notepad"
string with a name of your process
Kill specific PID manually
$ taskkill /PID <pid> /F
taskkill /PID 10844 /F
Find and kill the process using Windows Tools
- Start menu → All Programs → Accessories → System Tools → Resource Monitor
- or run
resmon.exe
, - or from TaskManager → Performance tab.
