How to add dependency on a Windows Service AFTER the service is installed
his can also be done via an elevated command prompt using the sc
command. The syntax is:
sc config [service name] depend= <Dependencies(separated by / (forward slash))>
Note: There is a space after the equals sign, and there is not one before it. So if you want ServiceA to depend on both ServiceB and ServiceC--that is to say, ServiceA will not start until the other two have started--then you would use this:
sc config ServiceA depend= ServiceB/ServiceC
Edit: Also, if you want to remove all dependencies, you have to use the following syntax:
sc config ServiceA depend= /
Warning: depend=
parameter will overwrite existing dependencies list, not append. So for example, if ServiceA already depends on ServiceB and ServiceC, if you run depend= ServiceD
, ServiceA will now depend only on ServiceD.