I tried it as follows:
System.Diagnostics.ProcessStartInfo process = new System.Diagnostics.ProcessStartInfo {
Arguments = "",
FileName = "regedit.exe",
UseShellExecute = true,
Verb = "runas",
WorkingDirectory = Environment.CurrentDirectory
};
try {
System.Diagnostics.Process.Start(process);
} catch {
// error handling
}
The C# app I am running the code from is elevated and opens Regedit but neither does it prompt for UAC nor is HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node visible. That key is only visible when I open regedit manually.
What am I doing wrong?