How to stop a hanging Windows service


Windows processes and services can be controlled with the task manager, but occasionally I found hanging processes that required a reboot.

Windows has some useful command line tools that could help avoiding a reboot and save some time:

1) Open command line prompt (cmd) as Administrator

2) Find process id with sc queryex {servicename}, e.g. sc queryex Apache2.4. You can also use tasklist|find "{executable}", e.g. tasklist|find "httpd"

3) Kill the process with taskkill /f /pid {PID}, e.g. taskkill /f /pid 1712