Home > Security, Windows > How to set Run this program as Administrator via registry

How to set Run this program as Administrator via registry

At one of my customer I was implementing SAP GUI into Terminal Services farm. When you run SAP GUI as Administrator, SAP GUI works perfectly.

One solution is to force SAP GUI (or other applications) to “run as Administrator” priviledge by GPO or other central managed way. Solution is following:

For current user you can set following registry key:

<strong>HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers</strong>


For all users:

<strong>HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AppCompatFlags\\Layers</strong>


Under specific registry key:

  • Create REG_SZ value with name as full path to executable (if path contains spaces, do not surround it with quotes)
  • Data for this value must contain string RUNASADMIN

As showed on picture:


Disable UAC for application

Disable UAC for application


And now we have SAP GUI functional normally.



  1. Allen
    February 25th, 2014 at 12:36 | #1


    Tried it. it works! thanks man.

  2. February 25th, 2014 at 13:00 | #2

    You are welcome.

  3. Will S.
    August 14th, 2014 at 14:36 | #3

    I have a VDI infrastructure that we had several applications that would need to be run as admin. This trick of yours saved me from having to educate all my users on how to right-mouse-click and run as admin!

    Good on you sir!

  4. poynter admin
    June 17th, 2015 at 10:48 | #4

    A year on and this article is still solving problems. thanks a million for this you just saved me rebuilding 3 laptops.

  5. June 17th, 2015 at 18:27 | #5

    Have to help you out 🙂

  6. July 9th, 2016 at 10:36 | #6

    Hi Ondrej, thanks for sharing this. But is there a way to run a specific application always as admin via GPO without making user a local admin or domain admin?

  7. July 18th, 2016 at 13:57 | #7

    Do you mean to run application when someone non-admin logs in?

  8. August 17th, 2016 at 03:37 | #8

    @Ondrej Žilinec
    Yupp. A way via GPO to run specific apps as admin even when non-admin is logged in.

  9. Sagar
    August 17th, 2016 at 14:01 | #9

    @Ondreh Zillinec Great Article!!! A knowledgeable one !!! I am working in an IT firm. In my office .. i don’t have admin access and admin password. I have figured out a way to download softwares exe on my machine. But is there any way by which i can install these softwares. I tried it with UNIEXTRACT.exe but it is not working for all softwares. Let me know if there any way or any article to follow for this.

    Thanks in advance

  1. No trackbacks yet.