How to stop a windows service in the stopping status

Source: Internet
Author: User

In work, you sometimes need to start and stop windows service, and sometimes the service is in the stopping or starting status. However, in the services interface, start service/stop service is in the gray unoperational status, net start/stop servicename in the form of command line does not help. The method to stop the service is to disable the process, but it is often unable to determine which process is related to it. In the command line, we can use the SC queryex servicename command to obtain information about the service.

For example,

Run 'SC queryex WebsenseDCAgent' in command prompt

The output is below,

SERVICE_NAME: WebsenseDCAgent
TYPE: 10 WIN32_OWN_PROCESS
STATE: 3 STOP_PENDING
(STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE: 0 (0x0)
SERVICE_EXIT_CODE: 0 (0x0)
CHECKPOINT: 0x0
WAIT_HINT: 0x1d4c8
PID: 4488
FLAGS:

After viewing the process number of this service, we can use the command 'taskkill/PID 4488/F' to force the process of this service to end./F means 'Kill forcely '.

650) this. width = 650; "title =" image "style =" border-left-0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/1S94I1K-0.png "width =" 545 "height =" 608 "/>

After a while, we will check the status of the service and it will automatically run again. OK.

650) this. width = 650; "title =" image "style =" border-left-0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/1S94H554-1.png "width =" 544 "height =" 425 "/>

Add the method described in hybriy1988:Right-click the Service and there is a Go to Process, which will be forwarded to the Process on which the Service depends, Kill it, and complete.

650) this. width = 650; "title =" image "style =" border-left-0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/1S94L153-2.png "width =" 448 "height =" 436 "/>

650) this. width = 650; "title =" image "style =" border-left-0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px "border =" 0 "alt =" image "src =" http://www.bkjia.com/uploads/allimg/131227/1S94M634-3.png "width =" 448 "height =" 544 "/>

 

SC function is very powerful, specific can refer to the following link: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ SC .mspx? Mfr = true

Related Article

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.