Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I view properties for a service, I can see the "Dependencies" tab, but I can't assign other services to this tab.

I have two services that start on startup, a server and a database. The server depends on the database - if the db hasn't started, the server doesn't work. (However, it does actually fail as a service, so I can't use the Recovery tab.)

How do I make the second service dependent on the first service, so that they always start up in the correct order?

share|improve this question
up vote 10 down vote accepted

From a command prompt running with admin credentials:

sc config <server_service_name> depend= <database_service_name>

Read more at this sc.exe documentation.

share|improve this answer
Wow, that's much easier, will try that next time. – Chris Kaufmann Apr 6 '11 at 18:27

Following the steps here worked perfectly for me:
Long story short:
regedit.exe, HKLM/System/CurrentControlSet/Services/(your service)
Add a multi value key named DependOnService
Add the dependency service name

share|improve this answer
Thanks, done that and the dependency looks to be created. (I'll restart later to verify it works and accept this answer then.) – Peter Boughton Apr 6 '11 at 16:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.