Kill process id in windows - force windows service to stop from stopping status
You can retrieve the PID for the process of the service through the command
sc queryex <servicename>
it returns some information like this
NOME_SERVIZIO: <servicename>
TIPO : 10 WIN32_OWN_PROCESS
STATO : 3 STOP_PENDING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
CODICE_USCITA_WIN32 : 0 (0x0)
CODICE_USCITA_SERVIZIO : 0 (0x0)
PUNTO_ARRESTO : 0x0
INDICAZIONE_ATTESA : 0x0
PID : 1824
FLAG :
Then you can stop the service by the command
taskkill /F /PID 1824 (the specific PID)
sc queryex <servicename>
it returns some information like this
NOME_SERVIZIO: <servicename>
TIPO : 10 WIN32_OWN_PROCESS
STATO : 3 STOP_PENDING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
CODICE_USCITA_WIN32 : 0 (0x0)
CODICE_USCITA_SERVIZIO : 0 (0x0)
PUNTO_ARRESTO : 0x0
INDICAZIONE_ATTESA : 0x0
PID : 1824
FLAG :
Then you can stop the service by the command
taskkill /F /PID 1824 (the specific PID)