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.
You can use Taskkill on Windows 2003 and 2008 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.
Make note of the service's short name
Find out the PID
sc queryex servicename
Still at the same command prompt, type the following and hit Enter, where [PID] is the PID that you just wrote down.
taskkill /f /pid [PID]
If this article helped you or if you have further suggestions, please feel free to comment below.
If you enjoy my writing, please consider subscribing to my articles or following me on Twitter @RaleighTech.