What is wrong with the following code?
ProcessStartInfo startInfo = default(ProcessStartInfo);
startInfo = new ProcessStartInfo(SetupProgramPath)
{
UseShellExecute = true,
Verb = "runas",
WindowStyle = ProcessWindowStyle.Normal,
CreateNoWindow = false
};
Process.Start(startInfo);
It is expected to prompt for credentials but nothing shows up. The system has the UAC enabled and not supposed to be changed. I appreciate your help in this one. Thank you in advance.
I have worked this out with the following code
ProcessStartInfo startInfo = default(ProcessStartInfo);
startInfo = new ProcessStartInfo(SetupProgramPath)
{
UseShellExecute = true,
Verb = "runas",
WindowStyle = ProcessWindowStyle.Normal,
FileName = "msiexec",
Arguments = "/i \"" + SetupProgramPath + "\"",
CreateNoWindow = false
};
Process.Start(startInfo);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With