All,
I am trying to stop the created Windows service, which depends on another service. I just want to stop both services using a batch file, such as the sc command, where the services are running on a remote machine.
I tried stopping the services in a dependent order (least dependent first), but this does not stop the service.
For example, Service1 depends on Service2, which is configured in the Service settings in the Services console. I am running a script on my Windows 7 PC, and Windows Server 2003 is running on the server.
The following lines are in the batch file I create:
sc \\SERVER stop "Service1"
sc \\SERVER stop "Service2"
The output in the command console is:
D:\Test>sc \\SERVER stop "Service2"
[SC] ControlService FAILED 1051:
A stop control has been sent to a service that other running services are dependent on.
Service2 will not stop. Service1 stops working.
Any ideas?
Thank,
Andez