WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Run Winbatch as a Service

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Anyway to Stop a Stop_Pending Service

Keywords:   stop_pending service

Question:

I am using WntSvcStatus with the request set to 3 for ControlsAccepted, to check what I may be able to do with an NT service that is in a Stop_Pending state, I am receiving a return of 5, there is no definition in the Win32 Network help file for this value only definitions for 1,2 & 4. Can anyone tell me what this state 5 is?

I have a service that is stuck in the Stop_Pending state. It refuses to stop when sent a single or multiple requests to do so using wntSvcControl control code of 1. Also IntControl 56 does not work with P1 = app name and P2 = 1. We really do need a method of stopping this particular service or the application it is run from.

Windows can stop the application because when a shutdown is requested we receive the wait or end process message boxes and if end is clicked the offending application is stopped, is there anyway to stop a service in this Stop_Pending state???

Answer:

The value 5 means the control codes that the service will accept and process are: (1) SERVICE_ACCEPT_STOP and (4) SERVICE_ACCEPT_SHUTDOWN

1 and 4 are bit flags that equal 5..... Stop Pending means the service has informed the service control manager that it will be stopping. I don't think sending more Stop commands would do any good at that point. As you describe it, Windows isn't stopping the service with a Stop command, it's killing it at shutdown.

If the service doesn't eventually go from Stop Pending to Stop on its own, it sounds like there is something wrong with the service.


Article ID:   W14946
File Created: 2001:11:08:12:41:06
Last Updated: 2001:11:08:12:41:06