您的位置:首页 > 其它

How to add dependency on a Windows Service AFTER the service is installed

2013-09-15 11:46 543 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐