How to Stop a Windows Service Which Is Stuck At Stopping - ilya-khadykin/notes-outdated GitHub Wiki

Sometimes there is a need to restart a service and you execute the following command:

net stop TermService

Tip: you can find out service name in services.msc console in its properties. And you expect that the service will stop properly.

BUT, the service may stuck in 'stopping state' which prevent you to start again.

Solution

To resolve this you should stop service process manually:

  1. Open cmd.exe ( as Administrator (if you have to)
  2. Execute the following command to find out PID of a process associated with the service:
sc queryex servicename
  1. Then we can kill the process by PID:
taskkill /f /pid [PID]

After you kill the process you can try to start the service again:

net start servicename