When I run dism /Online /Disable-Feature:Microsoft-Hyper-V-All
command from command prompt, It works fine.
But same I want to do from C# code. It does not work, Process exists with error code 11.
Process proc = new Process();
proc.StartInfo.FileName = "dism.exe";
proc.StartInfo.Arguments = "/Online /Disable-Feature:Microsoft-Hyper-V-All";
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.Verb = "runas";
proc.Start();
proc.WaitForExit();
int exitCode = proc.ExitCode;
Basically I want to run the given command from C# code (with UAC) as it works with command prompt.