How to Add a Dependency to a Windows Service

How to Add a Dependency to a Windows Service

Dependency on one other service:

sc config ServiceA depend= ServiceB

Above example means that ServiceA is dependent on ServiceB such ServiceA will not start until ServiceB has started. If you stop ServiceB, ServiceA will stop automatically.

Dependency on multiple other services:

sc config ServiceA depend= ServiceB/ServiceC/ServiceD/”Service name with spaces”

Above example means that ServiceA will not start until ServiceB, ServiceC, and ServiceD have all started. If any of ServiceB, ServiceC, or ServiceD has stopped, ServiceA will stop automatically.

To remove all dependencies:

sc config ServiceA depend= /

To list current dependencies:

sc qc ServiceA

Share this content:

2 Comments

25 PowerShell Commands Every Windows Admin Should Know – ArbrTech Posted on06:11 - 3 November 2026

[…] Restart a stuck service, or change how it starts. Add -WhatIf first if you are not sure which services a wildcard will match. If a service must wait for another one, see how to add a dependency to a Windows service. […]

How to Schedule a PowerShell Script with Task Scheduler (the Right Way) – ArbrTech Posted on06:01 - 5 November 2026

[…] Script depends on a service that starts late after a reboot: for -AtStartup triggers, add a delay with the trigger’s Delay property, or make the script wait for the service. If the dependency is between services, see how to add a dependency to a Windows service. […]

Leave a Reply