Windows Service Control

By Chris

We’ve been having some problems with our exchange server recently where a service will hang on a restart in the “Starting” state.  I finally figured out how to kill the process and restart it:

Open a Dos command shell and type:
SC queryex IMAP4SVC (for the IMAP service)

It will respond with:
TYPE                                       :    20    WIN32_SHARE_PROCESS
STATE                                   :    2        START_PENDING  (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES SHUTDOWN)
WIN32_EXIT CODE          : 0 (0×0)
SERVICE_EXIT_CODE    :  0 (0×0)
CHECKPOINT                     :   0×0
WAIT_HINT                        : 0×7d0
PID                                        :    200
FLAGS                                  :

From here we can find the Proccess ID (PID) and kill the service:
taskkill /PID 200 /F

One Response to “Windows Service Control”

  1. Pieter van der Kerk Says:

    I had exactly the same problem!
    Quick and good solution! Thanks.

Leave a Reply