How To Make A Button That Sets A File To Run As Admin

Is there a way to make a button that will set the selected .exe file's properties to Run as Administrator? I know that we can create a button and us the @admin to run any given program as Administrator, but that does not change the properties of that file. It's just a temp way to run it as admin.

I'm looking for a permanent solution, other than going to Properties/Compatibility/Run this program as an administrator

Create a button, set the function type to MS-DOS Batch Function, and then paste this as the function definition:

reg add "HKCU\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v {f} /t REG_SZ /d "~ RUNASADMIN"

Amazing! It works flawlessly. I didn't even know if it could be done, and once again, Opus shows it's muscles.

Thank you very much!!

1 Like