9

On Windows 8.1, the following registry change allowed a user with Administrator privileges to launch a particular application without the User Access Control popup warning about changes being made to the computer:

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\path\\to\\app\MyApp.exe"="RunAsInvoker"

For example, to open Registry Editor or merge .reg files with the UAC prompt:

"C:\\Windows\\regedit.exe"="RunAsInvoker"

Can't get this to work on Windows 10 - the UAC prompt happens regardless. Is this possible on Windows 10?

1
  • Hi, I found if you run the program from an elevated command prompt, then the program stays elevated. If you run the program from a non-elevated command prompt, then the program stays non-elevated. Please refer to: devblogs.microsoft.com/oldnewthing/20161117-00/?p=94735 So I think that is why it not work for you, might be not configured as admin in registry
    – JoyQiao
    Commented Dec 8, 2020 at 7:39

5 Answers 5

12

You can do this with Task Scheduler. This will be much better than mucking around with the Registry which can go bad all too easily.

Disable UAC for a Specific App

Windows: User Account Control can be obnoxious when it prompts you for approval on certain apps every time.

Tips and tricks blog MakeUseOf suggests adding frequent offenders to Task Scheduler to avoid this annoyance.

The process is a little tedious, but easy enough if you're familiar with Task Scheduler:

In Task Scheduler, right-click "Task Scheduler Library" and select "New Folder" Name it whatever you would like.

Select the new folder and click "Create Task" (not "Create Basic Task")

Name the task something descriptive. Enable "Run with highest privileges," and select your OS under "Configure for."

Under the Actions tab, select "Start a program" in the Action dropdown if it isn't already. Click Browse and find your app's .exe file (usually under Program Files on your C: drive).

(Laptops) Under Conditions tab, deselect "Start the task only if the computer is on AC power."

On your desktop, right click and select New > Shortcut. Paste 'C:\Windows\System32\schtasks.exe /RUN /TN "Name of folder\Name of task" into the text box.

This will create a link to your program that will automatically skip the prompt asking for permission to make changes to your computer.

The app's icon won't transfer over, but this can be easily fixed.

This solution can be used to start programs from Startup folder, if UAC intercept them (non-system programs). Otherwise, UAC will block program (without prompt or any clue what happened) and it will never start.

The above worked for me when I replaced spaces with underscores from the Scheduler Folder and Task name

3

Regarding the Registry Editor question I have found a working solution on Windows 10 21H2 when editing directly with RegEdit. The Task Scheduler answer unfortunately didn't work for me as nothing happens when running the shortcut created which is why I went for the following Registry Editor solution.

In the registry, instead of the RUNASADMIN instruction as the value data attached to the string value with the app/program address I'm using ~ RUNASINVOKER. This at least works flawlessly for me as an invoker as I'm using an admin user account. When you're at the registry address as instructed above

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]

you can either add your specific program or edit an existing string. Either way an example would look like following D:\APPS\HWAIDA64_Extreme\AIDA64_Extreme_6.60.5900\aida64.exe as the string value/name, ~ RUNASINVOKER as the value data.

I'm sorry but this is my first SuperUser post so don't know how to most clearly or best describe my solution/answer so I hope it isn't too confusing.

*Edit So the programs I initially used to test this method for apparently didn't need to be run as admin for them to function. At least not how I were using them at first. This meant that as soon as I tried this method on an application that did needed to be run with elevated privileges I hit a snag as soon as I ran that application with the ~ RUNASINVOKER instruction added with the Registry Editor. The application became inoperable. This really sucks and since the Task Scheduler solution doesn't work I'm crap outta luck and back to square one. Really wished someone with the knowhow could simply create a small batch file/script/application or whathaveyou that made it easy to just add whatever program you want to a whitelist where all your desired NON UAC prompt programs could be added... Alas...this will in all likelihood remain a dream.

2
  • Don't know what to say... maybe it depends on the app / poorly coded? I'm using a registry editor with more features, before ~ RUNASINVOKER UAC would prompt, now it doesn't, and it works as intended, it writes to registry perfectly fine without the prompt. So thanks for the tip!
    – JasonXA
    Commented Aug 7, 2022 at 10:33
  • This method disables the UAC prompt but the program does not run as administrator
    – zstadler
    Commented Dec 8, 2022 at 8:40
0

This can be done easily with the portable tool UAC Pass (download here).

With the programs that I start this way, I'm only seeing the problem that these programs are suddenly no longer correctly DPI-aware on high-res monitors, strangely only in certain areas of the program window, e.g. only in the toolbars of the respective program.

This is certainly not due to UAC Pass, but probably is related generally to the start method via Task Scheduler.

0

SOLVED!

Uses drag & drop and windows shell's context menu's "open with" to write an exe wrapped vbsfile with path of the target that then opens an elevated task to defeat UAC per program - appears to be the only option capable of getting commandline arguments to work while defeating UAC.

OK - this is a multistepped issue I have overcome! (for personal use) - LOL

First I noticed that during the UAC lockscreen the commandline had 2 switches inserted before the original WScript.Arguments and it was breaking programs ability to "drag&drop" onto [exefile] or use "Open with" from context menu because the WScript.Arguments(0) was now WScript.Arguments(2).

I was able to over come this by registry entry:

**Registry Entry**
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\FolderName\\ProgramName.exe"="~RUNASADMIN"

After doing the above the UAC entries no longer showed up on the commandline for either the context menu or drag&drop!

Now I was unable to keep the commandline arguments after making the UAC stop no matter if I used TaskScheduler or the 3rd party UAC Trust Shortcut since there was no way to add a %variable% or a "%1" with any of these programs only accepting static commandlines.

I was able to get a [vbsfile] to use drag&drop and parse all the WScript.Arguments then write that result into another [vbsfile] parsing the commandline that I could then open with Task Scheduler to a static filename then avoiding the dreaded UAC Prompt!

**VBSfile to use as drag&drop target**
Set fso=CreateObject("Scripting.FileSystemObject")
Set objFile = fso.CreateTextFile("C:\FolderName\VBStoParseCommandline.vbs" , True)
If WScript.Arguments.Count=0 Then
   hhh=""
Else
   hhh=WScript.Arguments(0)
     If Ucase(fso.GetExtensionName(hhh)) = "LNK" Then
        set Ws = CreateObject("WScript.Shell")
        set Lnk = Ws.Createshortcut(hhh)
        hhh=Lnk.TargetPath
     End If
End If  
objFile.WriteLine("CreateObject(""Wscript.Shell"").Run ""C:\FolderName\VBStoParseCommandline.vbs """"" & hhh & """"""" , 1, False")
CreateObject("Wscript.Shell").Run "SCHTASKS /Run /TN ""VBStoParseCommandline"""

Not only will this create another [vbsfile] but it will also trigger the Task Scheduler that will then open the new VBScript to open the original program with no UAC prompt!

Here is an example of the [vbsfile] that the drag&drop target file will write:

**called by the Task Scheduler**
CreateObject("Wscript.Shell").Run "C:\FolderName\OriginalProgramName.exe ""C:\FolderName\CommandlineArgumentIwasTryingToGet.png""" , 1, False

From here I had it all working with drag&drop from a shortcut [lnkfile] with a changed icon [icofile] but was unable to use the [vbsfile] with the context menu's "Open with" as the windows shell blocked it...

I was able to get a script wrapper named ScriptCryptor that behaves exactly as the [vbsfile] did but is now wrapped in an [exefile]. I was even able to wrap the icon from the original program and place it in the same location as ProgramNameNoUAC.exe avoiding the need for a shortcut and allowing all shell support.

Now I can Pin to Start as well as Pin to Taskbar and use context menu's "Open with" and have no UAC Prompt on a per program basis...

Given you now can cut and paste this to your project it can be a minute or less to repeat for another program...

image of folder view with added files and "Open with" from context menu

2
  • The absurdity never ends.
    – kreemoweet
    Commented Nov 16, 2022 at 18:36
  • well if does solve an issue that doesn't break the OS - all the other options only allowed the exe to open with no other arguments like the file it was to open. - It really sucked to use the open with from context menu then have the UAC prompt then have the program open then have to open the file inside the program again. - This solved all those issues... Commented Nov 16, 2022 at 18:45
0

Just go to:

[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers] in the Registry Editor.

Then, make a string value and put your .exe file's directory and set the value to ~ RUNASINVOKER. Works in Windows 11. I tried it.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Oct 20, 2023 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .