Here is the scenario: A .NET application is running as a user with non-adminstrator privileges. The application wants to start another process on the computer. The new process must run with administrator privileges. The administrator user name and password is known to the .NET application.
Is this possible to do on a Windows 10 computer. I was trying to use the code below without success.
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.UseShellExecute = false;
startInfo.FileName = fullPathToExecutable;
startInfo.Arguments = "";
startInfo.Domain = Environment.MachineName;
startInfo.Verb = "runas";
startInfo.UserName = "admin";
SecureString pass = new SecureString();
startInfo.Password = pass;
Process p = Process.Start(startInfo);