Languages
[Edit]
EN

Windows - how to kill process that listen on specific port with cmd?

6 points
Created by:
Marcin
18400

Quick solution:

netstat -ano | findstr LISTENING | findstr :your_port_number
taskkill /PID your_PID_number /F

1. Introduction

This article is focused to solve problem, how to kill process (PID) that listens on specific port under Windows CMD (Windows Command). Simple solution how to do it with taskkill command is described below.

2. taskkill program example

Do following steps:

Step 1. Run cmd.exe as Administrator

Step 2. Execute netstat command:

C:\>netstat -ano | findstr LISTENING | findstr :80
netstat listing processes that uses port 80 - Windows CMD
netstat listing processes that uses port 80 - Windows CMD

 Step 3. Execute taskkill command:

C:\>taskkill /PID 548 /F
taskkill apache2 killing process example - Windows CMD
taskkill apache2 killing process example - Windows CMD

Where:

  • for netstat -ano | findstr LISTENING | findstr :80┬ádouble fitering is used: by┬áLISTENING and later by :80; more detailed description can be found here,
  • for taskkill:
    • /PID 548┬árepresents killed process id,
    • /F stopd process event it does not responds.

Note: read more about netstat -ano here.

Native Advertising
­čÜÇ
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé

Join