What are valid characters in a Windows service (key) name?
-
03-07-2019 - |
Question
Does anyone happen to know what the convention for Windows service key names is, which characters are legal?
Solution
Based on the documentation for the underlying C++ structure used to create a service:
The maximum string length is 256 characters. The service control manager database preserves the case of the characters, but service name comparisons are always case insensitive. Forward-slash (/) and backslash (\) are not valid service name characters.
Additionally, the following rules apply to the "Display Name":
This string has a maximum length of 256 characters. The name is case-preserved in the service control manager. Display name comparisons are always case-insensitive.
OTHER TIPS
Additional Information to the Response from Richard Szalay.
According to ServiceInstaller.ServiceName on MSDN
The ServiceName cannot be null or have zero length. ... It also cannot contain ... characters from the ASCII character set with value less than decimal value 32.