I want to pull credentials for a service from a database (be more dynamic)
I am using sc.exe to change the credentials inside OnStart before I call .Start() on the service.
The sc.exe change works, but I noticed it doesn't take effect until after I restart again.
i.e. I notice it's SYSTEM as the user it's running as. Once I restart again its showing my domain account.
Is there any other way to change the Credentials that would allow me to do it inside OnStart before it actually runs?
Thanks, David