2

When the UAC is disabled, an application is launched in regular mode (i.e., it does not take into account the manifest) and the credentials window (for the administrator's login/password) does not appear.

Is there any way to force the Windows OS running the (.NET) application to run under Administrative Privileges (like the "Run as administrator" context menu does) from the (.NET) application code if the UAC is disabled?

Mikhail
  • 123
  • 7

1 Answers1

1
  • Right Click on the application and go to Properties
  • Go to the "Compatibility" tab
  • Check the "Run this program as an administrator" check-box.

C# .Net code to run an application with admin permissions:

ProcessStartInfo startInfo = new ProcessStartInfo(cmd); //cmd is the application you are trying to start
startInfo.Verb = "runas"; // This will set it to run as an administrator
startInfo.Arguments = args; // arguments to pass to the application that is being started
Process.Start(startInfo);

You can find some more info on this here

Winter Faulk
  • 471
  • 2
  • 14