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