Force Stop a Windows Service


Go to the command-prompt and query the service (e.g. the SMTP service) by using sc:

sc queryex SMTPSvc

This will give you the following information:

SERVICE_NAME: SMTPSvc

TYPE    : 20  WIN32_SHARE_PROCESS
STATE  : 4  RUNNING
(STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE       : 0  (0x0)
SERVICE_EXIT_CODE   : 0  (0x0)
CHECKPOINT               : 0x0
WAIT_HINT                   : 0x0
PID                               : 388
FLAGS

or something like this (the “state” will mention stopping). Over here you can find the process identifier (PID).

So it’s pretty easy to kill the associated process either by using the task manager or by using taskkill:

taskkill /PID 388 /F

where the /F flag is needed to force the process kill (first try without the flag).

Reklam

Bir Cevap Yazın

Aşağıya bilgilerinizi girin veya oturum açmak için bir simgeye tıklayın:

WordPress.com Logosu

WordPress.com hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Twitter resmi

Twitter hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Facebook fotoğrafı

Facebook hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap /  Değiştir )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.