Set RunAsAdmin compatibility settings via Registry

To programatically set application compatibility settings in Windows, add a registry value to one of the following locations:
[For the current user]
HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers
[For all users]
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

Under that key create a new REG_SZ entry with the value being the full path to the executable as the name (including the executable) and the data a space-separated list of compatibility flags (up to a max of 3).

In this instance we are just interested in making the app Run As Admin so we need the RUNASADMIN switch.

For example, you could paste this code into a text file, save it with a .reg extension and then run it on each PC in turn (or push out the registry changes via a GPO).

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
“C:\\Temp\\Example\\ExampleApp.exe”=”RUNASADMIN”

Related Posts

Need IT Help?

If you need assistance please feel free to reach out to us.