0
votes

I am attempting to start a hidden console application, but require the application to have elevated privileges.

I have successfully managed to have the UAC prompt appear, however can't get it to appear when I try to start the process hidden.

ProcessStartInfo proc = new ProcessStartInfo();
proc.UseShellExecute = false;
proc.FileName = "C:/example.exe";
proc.CreateNoWindow = true;
proc.Verb = "runas";

This will result in a process starting in the background, except without a prompt appearing (and without elevated priveleges). If I change UseShellExecute to true, then the UAC prompt appears, however the console window is visible too.

1
You can hide Console Windows using a Win32 API stackoverflow.com/a/3571628/495455Jeremy Thompson

1 Answers