Force run exe without administrator privileges

Set the __COMPAT_LAYER environment variable to RUNASINVOKER. For example, in cmd.exe:

> set __COMPAT_LAYER=RUNASINVOKER
> setup.exe

Registry config for a right-click option:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker]
@="Run without privilege elevation"

[HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker\command]
@="cmd /min /C \"set __COMPAT_LAYER=RUNASINVOKER && start \"\" \"%1\"\""

Batch file:

@echo off
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %1"

Posted

in

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *