Skip to main content

Windows Service with Status Stopping

  • March 16, 2023
  • 8 comments
  • 1862 views

wolff.mateus
Forum|alt.badge.img+11

Sometimes when trying to restart a service in Windows, the service happens to have a status of Stopping. As a result, it ends up getting stuck and without the possibility of giving the stop and start command. Here in this case, we can see the Veeam Backup Enterprise Manager service crashed:

 

So we need to terminate the process of this service through the command prompt. For that, you need to use the following command:

sc queryex <service>

Now we can obtain the PID (process identifier) of the process related to the crashed service:

 

With the PID number in hands, just run the command below:

taskkill /pid <PID> /f

This way the process is closed and you can start it again normally:

 

8 comments

Chris.Childerhose
Forum|alt.badge.img+21
  • Veeam Legend, Veeam Vanguard
  • 9586 comments
  • March 16, 2023

Very cool @wolff.mateus learn something new today.  Will keep this reference for future use. Thanks for sharing 👍


Andanet
Forum|alt.badge.img+11
  • Veeam Legend
  • 422 comments
  • March 16, 2023

Yep @wolff.mateus to check list of services you also can use

tasklist | findstr Services 

or 

tasklist | findstr Nameofservice 

this command list all (or specific) services with PID number and mem usage and you can kill it. 

The biggest problem is its troubleshooting that need to spent a lot of time. 😖


wolff.mateus
Forum|alt.badge.img+11
  • Author
  • Veeam Vanguard
  • 588 comments
  • March 16, 2023

Yep @wolff.mateus to check list of services you also can use

tasklist | findstr Services 

or 

tasklist | findstr Nameofservice 

this command list all (or specific) services with PID number and mem usage and you can kill it. 

The biggest problem is its troubleshooting that need to spent a lot of time. 😖

Nice to know @Andanet! Thanks for that.


JonahMay
Forum|alt.badge.img+11
  • Veeam Vanguard
  • 48 comments
  • March 16, 2023

For the PowerShell folks:

$id = (get-wmiobject win32_service | where { $_.name -eq ‘ServiceName’}).processID

Stop-Process $id -Force

 


Chris.Childerhose
Forum|alt.badge.img+21
  • Veeam Legend, Veeam Vanguard
  • 9586 comments
  • March 16, 2023

For the PowerShell folks:

$id = (get-wmiobject win32_service | where { $_.name -eq ‘ServiceName’}).processID

Stop-Process $id -Force

 

Ah yes good old PowerShell.  Love this for sure. 😀


dloseke
Forum|alt.badge.img+8
  • Veeam Vanguard
  • 1459 comments
  • March 16, 2023

I tend to use “taskkill /IM executablename.exe /F” to kill off the processes, but that requires you know the image name.


Iams3le
Forum|alt.badge.img+11
  • Veeam Legend
  • 1547 comments
  • March 16, 2023

These are handy commands! A a lot of users will find this content useful..


Iams3le
Forum|alt.badge.img+11
  • Veeam Legend
  • 1547 comments
  • March 16, 2023

For the PowerShell folks:

$id = (get-wmiobject win32_service | where { $_.name -eq ‘ServiceName’}).processID

Stop-Process $id -Force

 

Awesome! Sometimes, the Get-WMIObject cmdlets still works and other times they don’t. By the way, this cmdlets have been superseded with the CimInstance cmdlet.