Sometime I have problem with service which is in status “starting” or “stopping”. Below I will show you how to resolve it without server restart. In most cases it should help.
First, we have to determine service name of service which is hanged. The easiest way is checking it via services.msc and then check properties of service.
Next, we need to execute command in CMD. CMD should be started with elevated rights.
1 |
sc queryex servicename |
servicename is name of problematic service. In our case complete command will be like that:
1 |
sc queryex spooler |
In this step we need to copy PID number to have it as a parameter in next command, which will terminate process with specified PID. To make it we need to execute command:
1 |
taskkill /f /pid [PID] |
In our case complete command will be:
1 |
taskkill /f /pid 2332 |
In case command will be properly executed you will be informed about success.
Remember, that this method will not work in case of some critical Windows services. I such cases restart could be required.