Sometimes you will find yourself in a situation where a Windows service is stuck and cannot be stopped through Task Manager or the Windows Services application. Be careful which services you are stopping. If you stop an important Windows service the server could reboot. Follow the steps below to kill the service.
- Identify the Service Name. In the Services application locate your service, right click and select Properties. You will need the service name and not the display name.
2. Identify the Process Identifier Number (PID) of the service. Open the command prompt with administrator privileges and type the command shown below. Replace servicename with the name of the service from step.
sc queryex servicename
Make note of the PID. In the screenshot below it is 5952.
3. Use taskkill to stop the PID. From the same CMD type in the command shown below. Replace PID with the PID number from step 2. If it is successful it should return SUCCESS: The process with PID #### has been terminated
taskkill /f /pid PID