A
Agnes
Hi,
I am trying to start a new process as a different user from a Windows
Service.
When I start the process from a console application, it works perfectly.
But if I do the same thing from the Windows service, it gives an Application
Error: The applcation failed to initialize properly (0xc0000142).
My code looks like this:
Process p = new Process();
p.StartInfo.FileName = "somePathToThe.EXE";
p.StartInfo.Arguments = "some arguments";
p.StartInfo.UserName = "theUser@Domain";
p.StartInfo.Password = passwordInSecureString;
p.StartInfo.UseShellExecute = false;
p.Start();
Did I do something wrong? But it works when running in a console app. Is
it not allowed when running as windows service??
Thank you for your help!!
Agnes
I am trying to start a new process as a different user from a Windows
Service.
When I start the process from a console application, it works perfectly.
But if I do the same thing from the Windows service, it gives an Application
Error: The applcation failed to initialize properly (0xc0000142).
My code looks like this:
Process p = new Process();
p.StartInfo.FileName = "somePathToThe.EXE";
p.StartInfo.Arguments = "some arguments";
p.StartInfo.UserName = "theUser@Domain";
p.StartInfo.Password = passwordInSecureString;
p.StartInfo.UseShellExecute = false;
p.Start();
Did I do something wrong? But it works when running in a console app. Is
it not allowed when running as windows service??
Thank you for your help!!
Agnes