I implemented this using the LogonUser function, as you guys mentioned (by the way, this service requires WinXP SP2 or later, so I'm not worried about the privilege issue). However, this is not quite as I hoped. If I call QueryServiceConfig, lpServiceStartName is in the format ". \ Accountname". If I pass this line, as in LogonUser, it fails. I assume the part before the "\" represents the machine on which the user belongs?
Also, if I call ChangeServiceConfig with "LocalSystem" and "" for the lpServiceStartName and lpPassword parameters respectively, this works fine. However, calling LogonUser does not work with these parameters.
I would really like to use the same syntax that SCM uses for account names.
Jason
source share