L
ludwig.stuyck
Hi all,
I need to start an executable from within a windows service. I tried
the following code in the windows service:
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "filename.exe";
psi.Arguments = "arg1 arg2";
psi.UseShellExecute = false;
psi.Domain = "domain";
psi.UserName = "username";
string password = "password";
SecureString secureString = new SecureString();
foreach (char c in password) { secureString.AppendChar(c); }
psi.Password = secureString;
Process process = new Process();
process.StartInfo = psi;
process.Start();
However, when the Start() method is executed I always get the error
"Access is denied".
Can someone tell me what could be wrong or what the reason may be for
the error?
Thanks!
I need to start an executable from within a windows service. I tried
the following code in the windows service:
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "filename.exe";
psi.Arguments = "arg1 arg2";
psi.UseShellExecute = false;
psi.Domain = "domain";
psi.UserName = "username";
string password = "password";
SecureString secureString = new SecureString();
foreach (char c in password) { secureString.AppendChar(c); }
psi.Password = secureString;
Process process = new Process();
process.StartInfo = psi;
process.Start();
However, when the Start() method is executed I always get the error
"Access is denied".
Can someone tell me what could be wrong or what the reason may be for
the error?
Thanks!