Always Run As Admin

email me

A simple way to force an EXE to run as admin is to use the registry. You just add the path to the specific EXE here:

The Reg Key

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
C:\\MyApp\\MyCoolApp.exe“=”~ RUNASADMIN” 



This is essentially what’s happening

 

 

For each application there are three settings that can be applied. The compatibility mode, (Display) Settings and the Privilege Level. One or multiple values can be set (separated by a space).

Compatibility Modes

Value Description
WIN95 Windows 95
WIN98 Windows 98
WIN4SP5 Windows NT 4.0 SP5
WIN2000 Windows 2000
WINXPSP2 Windows XP SP2
WINXPSP3 Windows XP SP3
VISTARTM Vista
VISTASP1 Vista SP1
VISTASP2 Vista SP2
WIN7RTM Windows 7
WINSRV03SP1 Windows Server 2003 SP1
WINSRV08SP1 Windows Server 2008 SP1

 

Display Settings

Value Description
DISABLETHEMES Disable Visual Themes
640X480 Run in 640 x 480 screen resolution
HIGHDPIAWARE Disable display scaling on high DPI settings
256COLOR Run in 256 colors
DISABLEDWM Disable Desktop Composition

 

Privilege Level

Value Description
RUNASADMIN Run program as an administrator

 

If the settings are written into the HKEY_LOCAL_MACHINE part of the registry, the settings cannot be changed by a user that has no local administrative rights.

Windows Server 2008 SP1