Start/stop Windows Service A also Start/stop Windows service B

Posted by Sean on Server Fault See other posts from Server Fault or by Sean
Published on 2011-11-29T19:06:26Z Indexed on 2011/11/30 18:00 UTC
Read the original article Hit count: 562

I created two Windows services A and B, and would like to add dependency between them so that I can:

  1. Start service A (service B starts automatically)

  2. Stop service A (service B stops automatically)

However, the command sc config ServiceA depend= ServiceB only works for:

  1. Start service A (service B starts automatically)

  2. Stop service B (service A stops automatically)

Is there any way to make service B stop automatically when I stop service A?

© Server Fault or respective owner

Related posts about windows-server-2003

Related posts about Services