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:app

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:this

sc config ServiceA depend= ServiceB/ServiceC

Edit: Also, if you want to remove all dependencies, you have to use the following syntax:spa

sc config ServiceA depend= /

Warningdepend= 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. code

相關文章
相關標籤/搜索