Friday, July 14, 2017

Kill Windows Processes and Services by Port Number

Each and every Windows Operating System uses the Desktop Application, Command line instruction and many background processes for executing and performing the job.

But Sometimes It becomes so difficult to close the application by the mouse when Application or Windows services are not responding.  Windows comes with another feature for terminating services by the knowledge of the port number on which process is running on by command line instruction.

In this post, I am going to give you the example of command line instruction for terminating the windows services by the knowledge of port number.

Let me, In my system I have started MySQL server. MySQL services run on the port number 3306 by default, if the user has not changes the port number during the installation process. So I will open my Command prompt and I will type




netstat -a -o


This statement will enlist all the running services detail along with the Port Number and PID number.
I will track the PID with knowledge of the port number and after I will use that PID number for executing the service running on the given  Port Number.

Command line Instruction for terminating service by the acknowledgment of PID number.




taskkill /pid <PID NUMBER> /f



The above-given command will terminate the service running on the given port number.
So finally windows process or service which running on Port Number 3306 i.e. PID Number - 2716
will be terminated.


Privacy Policy
About Us