Kill Window Service that hang on state “STOPPING” or “STARTING” in services.msc window
Suppose you are on services screen on window and you started the service by right click and start the service then it show status starting but does not respond beyond (means hanged state). Without restart the window machine you can kill the service by following commands from command prompt:
1. Check the service name with following command:
sc queryex OracleDBconsolePEGA
TYPE : 10 WIN32_OWN_PROCESS
STATE : 2 START_PENDING
(NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x2a
WAIT_HINT : 0x2710
PID : 94196
2. It will give you the Pid of the services on which its running.
3. Kill service by taskkill command:
C:\>taskkill /pid 94196
ERROR: The process with PID 94196 could not be terminated.
Reason: This process can only be terminated forcefully (with /F option).C:\>taskkill /pid 94196 /F
SUCCESS: The process with PID 94196 has been terminated.