A service stuck in a stopping or starting state can make for a frustrating experience for a Windows systems administrator trying to avoid a mid-day server restart.


Almost any service could hang, but it typically happens with critical application services such as those involved in Microsoft Exchange, like IMAP. Using the DOS Taskkill command can allow you to put off rebooting the server until after business hours.

  1. In Server Manager, find the stuck service and double click it.
  2. Make note of the service's short name (also known as Registry name). For example, Windows Update would be called WUAUSERV.
  3. Launch a command prompt (for Windows 2008 or later, run as Administrator).
  4. Type the following, where servicename is the service name that you noted above, and hit Enter.
sc queryex servicename

e.g. sc queryex wuauserv
  1. From the results of this query, write down the PID.
  2. Still at the same command prompt, type the following and hit Enter, where [PID] is the PID that you just noted.
taskkill /f /pid [PID]

e.g. taskkill /f /pid 1864

This will forcibly kill the frozen service. You can now return to Server Manager and restart the service.

You can use Taskkill on Windows 2003, 2008 and 2012 servers, and also on workstations running Windows XP Professional, Windows Vista and Windows 7. On a workstation, though, it's often easier to just restart the computer.

For a server, even after completing these steps, it's probably a good idea to restart at the next opportunity.
 

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.