I’m trying to start a service as a user and things work fine, until I try a user that doesn’t have a password. Then, it fails to start (due to log-on error).
Am I doing something wrong or is this ‘by design’?
The code to register this service:
SC_HANDLE schService = CreateService( schSCManager, strNameNoSpaces, strServiceName, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_NORMAL, szPath, NULL, NULL, NULL, strUser, (strPassword.IsEmpty())?NULL:strPassword);
It may be due to an OS security requirement or security policy. Check the security policies to see if anything is relevant there.