2012年2月5日 星期日

Kill Windows Services that Hang on "Stopping"

Step-by-step
  1. In the command prompt, execute sc queryex w32time. The service name is w32time for example. The information is here:
    SERVICE_NAME: w32time
            TYPE               : 20  WIN32_SHARE_PROCESS
            STATE              : 4  RUNNING
                                    (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
            WIN32_EXIT_CODE    : 0  (0x0)
            SERVICE_EXIT_CODE  : 0  (0x0)
            CHECKPOINT         : 0x0
            WAIT_HINT          : 0x0
            PID                : 1352
            FLAGS              :
    
    The PID of the service is 1352. We will kill the service by this PID.
  2. In the command prompt, try to execute taskkill /PID 1352 first. If the service is alive, execute taskkill /PID 1352 /F. The /F flag means forcefully terminating the process.

Reference:

沒有留言:

張貼留言