I'm trying to create something in C# like sudo for Linux. I found a way to run the process as a different user using the password, but I want to do this without the password.
Also, my C# software is running as Administrator and has passed UAC.
My currently Code:
static void CreateProcessAsUser(string name, string path, SecureString password)
{
Process proc = new Process();
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.FileName = path;
proc.StartInfo.UserName = name;
proc.StartInfo.Password = password;
proc.Start();
}
Thank you.