I have a program that runs Elevated. From this program I launch other executables.
Now by default any process I create will run Elevated. So, for some programs it runs, I want them to run as if they were not elevated, as the standard user who's logged in.
The main Elevated program is running under the user account of the logged in user.
So this is what I tried
var psi = new ProcessStartInfo(Exe.GetExePath());
psi.UseShellExecute = false;
psi.RedirectStandardError = false;
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = false;
psi.WorkingDirectory = Exe.Version.GetInstallPath();
if(Exe.Elevated == false)
{
psi.UserName = Global.Username;
var pass = new SecureString();
Global.Password.ToCharArray().ToList().ForEach(p => pass.AppendChar(p));
psi.Password = pass;
}
Process = Process.Start(psi);
That works, as in the started program is not Elevated. However, it at that point loses access to all mapped network drives for some odd reason.
I even tried doing something like this Impersonating a Windows user from within the application that launches, and it also doesn't work.
So I guess I'm wondering, how can I gain back access to these mapped drives (all applications are running under the correct user).