I've got this project that needs to get finished in two days and I'm nearly done with it. Except there's a part of it that needs to start another app and run it as a different domain user.
So far I've got this in code:
Process proc = new Process();
System.Security.SecureString ssPwd = new System.Security.SecureString();
string password = "SomePassword";
for (int x = 0; x < password.Length; x++)
{
ssPwd.AppendChar(password[x]);
}
ProcessStartInfo StartInfo = new ProcessStartInfo
{
FileName = "Translink.exe",
WorkingDirectory = @"C:\Program Files\Western Union\Universal-Release",
UserName = "someuser",
Domain = "somedomain",
Password = ssPwd,
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true
};
proc = Process.Start(StartInfo);
proc.WaitForExit();
So when I make a call with and without user and password for example: C:\Windows\System32\notepad.exe it runs in both cases but everytime I try to run that particular app "Translink.exe" from either Program Files or Program Files (x86) it just won't run at all with or without runas.
And I've ran out of things to try, I think I've tried everything so far in stackoverflow as there were other similar articles but I think I must be going wrong somewhere specifically.