Stop a hung service shuts down a non-responsive windows services

Source: Internet
Author: User

If you ever has trouble with a service being stuck in a ' starting ' or ' stopping ' state, you can run a couple of simple co Mmands to kill the service.

1. query the process

to kill the Service know its PID or Process ID. To find this just type the following with at a command prompt:

sc queryex servicename 
<enter>

Rep Lace ' ServiceName ' with the Services registry name. For Example:print Spooler is Spooler.

 


C:\users\yemen_000>sc queryex mssql$sqlexpress

service_name:mssql$sqlexpress
Type:10 WIN32_OWN _process
State:4 RUNNING
(stoppable, pausable, Accepts_shutdown)
win32_exit_code:0 (0x0)
Service_exit_ code:0 (0x0)
checkpoint:0x0
wait_hint:0x0
pid:2184
FLAGS:

 
&NBSP;
2. Identify the PID

After running the query, you'll by presented with a list of details. You'll want to locate the PID.

3. Run the Taskkill command

Now so you had the PID, you can run the following command to kill the hung process:

taskkill/f/pid [PID]
<Enter>

This would force kill the hung service.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.