"SC.EXE config" and dollar sign in service name
- by Joe Schmoe
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?