Kill Task on Specific Port Windows Command Line

Some times we want to kill task on specific port in order to start the task we want to run. Many times if this is happens what we do is , normally we do restart. Here is simple technique to kill specific task that runs on specific port without restarting the our system.

1. First we need find out task ID which runs on the specific port using following command.

C:\Users\username>netstat -o -n -a | findstr 0.0:80

suppose I want to kill the task that runs on the port 80, then I will run the following command to get task ID that runs on port 80. It will gives result like this.

TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1344

2. Next we need to kill the task using task ID we got from previous command.