I need to run/start an installation exe from my c# app and would like to cache/embed my admin credentials so the user does not need to see the UAC request to provide them as the users in my organisation do not have admin privileges.
I have tried to setup the SecureString
for the password but NetworkCredential
throws an error
SecureString theSecureString = new NetworkCredential("", "password").SecurePassword;
Process installProcess = new Process();
installProcess.StartInfo.UseShellExecute = false;
installProcess.StartInfo.UserName = "admin";
installProcess.StartInfo.Password = theSecureString;
installProcess.StartInfo.FileName = @"installer.exe";
installProcess.Start();