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

Say I want to make Windows Service startup dependent on SQL Server.

In my case service name for SQL Server is MSSQL$SQL11 (SQL11 is SQL Server instance name)

However, when I issue this command:

SC.EXE config MyService depend= MSSQL$SQL11

everything after the dollar sign is ignored. When I go to "Dependencies" tab in "Services" SQL Server is not listed. When I check matching registry key it becomes clear why: it only has MSSQL. At this point I have to edit registry by hand to change MSSQL to MSSQL$SQL11 and then everything works as expected.

Putting quotes around MSSQL$SQL11 doesn't help.

Is there a way to specify $ in the middle of the SC.EXE argument string?

share|improve this question
up vote 1 down vote accepted

I figured it out - one needs to put double quotes around dollar sign:

SC.EXE config MyService depend= MSSQL"$"SQL11

share|improve this answer
Did you try SC.EXE config MyService depend= "MSSQL$SQL11" ? I'm not sure if it works, just wondering if you tried it. – gparent Jun 4 '12 at 3:01
@gparent, perhaps you missed "Putting quotes around MSSQL$SQL11 doesn't help" in the question. – John Gardeniers Jun 4 '12 at 12:06
Indeed, I am a retard. Thank you. – gparent Jun 4 '12 at 13:39

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.