Casing when creating a Windows service using sc.exe

1.7k Views Asked by At

When I use the command:

sc create "myservice" binPath= "C:\somepath\whatever.exe" DisplayName= "MyService" start= auto obj= ".\username" password= password

the service is created as follows:

DisplayName: myservice

ServiceName: myservice

As you can see, it completely ignores the casing I specified in DisplayName.

However, if I use the command:

sc create "myservice" binPath= "C:\somepath\whatever.exe" DisplayName= "My Service" start= auto obj= ".\username" password= password

the service is created as follows:

DisplayName: My Service

ServiceName: myservice

In my first command example what causes sc.exe to ignore the casing of the displayname I specified? Is there another way to create the service with the specified casing?

From an operations perspective the service names don't matter, but I'm trying to appease someone else's sense of aesthetics.

0

There are 0 best solutions below