How to force shutdown services

Source: Internet
Author: User

Sometimes it is necessary to start and stop Windows Service at work, sometimes the service is in stopping or starting state, but in the Services interface, start Service/stop The service is already in a gray, non-operational state, and using the command line form of net start/stop servicename is useless. The method of stopping the service is to turn off the process, but many times it is not possible to determine which process is associated with it. At the command line we can use the SC queryex servicename command to get 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 force the process of ending this service with the command ' Taskkill/pid 4488/f '. /F means ' kill forcely '.

Original: http://allanfan.blog.51cto.com/520839/1193132/

How to force shutdown services

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.