| Previous | Next |
| ERROR_INVALID_DOMAINNAME | ERROR_INVALID_NETNAME |
ERROR_INVALID_SERVICENAME
The service name format is invalid
CreateService uses the service name as the SCM database identifier. Microsoft documents a maximum length of 256 characters; forward slash and backslash are not valid service-name characters, and comparisons are case-insensitive even though case is preserved.
Validate the internal service name before calling SCM APIs and keep it separate from the display name shown in management tools. Deployment systems sometimes pass a filesystem path, display label, or tenant-qualified string into the service-name field by mistake. Log both fields independently. If names are generated, define a restricted character set and deterministic length limit before installation so that upgrade and uninstall code computes the same identifier as the original installer.
What to inspect
- Check length and reject slash characters in the internal service name.
- Do not substitute the display name or executable path for the service name.
- Use the same deterministic naming rule for install, upgrade, query, and uninstall.
References
Looking for a different code? Search another status or error code.