Products > Computers

Windows question-How does this registry commond work?

(1/2) > >>

Logan:
Hello guys.

So here is a .reg file which add a option on your right click menu, to allow you to run programs needing admin privilege as normal user, without UAC prompt:

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\"\""

It does works well. But I don't know how it works, especially the last line with lots of symbols... Can anyone explain that?

Thanks a lot!

DrG:
I am thinking that you saw and used https://gist.github.com/ZigaBobnar/7ce7901b23b712ac38f51b98e40c6411

I would answer you like this. Those registry values don't do anything at all on their own but they act like variables that the OS uses for all sorts of things. So, you really need to know how the OS is using those keys.

To understand "the last line with lots of symbols" you need to start looking at the syntax required to mess around (e.g., assign values to keys in an editor/ file) with this stuff - see, for example, https://ss64.com/nt/reg.html

Caution: This could give you a headache quickly as well as cause you a lot of OS problems.

IanB:
There should already be a "Run as administrator" option on your right click mouse menu in Windows 10, without making any registry changes?

As for what all those symbols mean, you can get a start by opening a command prompt and typing "help cmd".

By the way, bypassing UAC is a really bad idea. Don't do that unless you like to live dangerously.

Ian.M:
https://devblogs.microsoft.com/oldnewthing/20161117-00/?p=94735
explains

--- Code: ---set __COMPAT_LAYER=RUNASINVOKER
--- End code ---
N.B. It does *NOT* bypass UAC and does *NOT* let you run programs that *NEED* admin privileges.  Instead it lies to programs that *THINK* they need admin privileges so they'll run until/unless they actually need admin privileges at which point they'll either silently fail or error out.

Logan:

--- Quote from: IanB on May 16, 2021, 05:38:14 pm ---There should already be a "Run as administrator" option on your right click mouse menu in Windows 10, without making any registry changes?

As for what all those symbols mean, you can get a start by opening a command prompt and typing "help cmd".

By the way, bypassing UAC is a really bad idea. Don't do that unless you like to live dangerously.

--- End quote ---

Thanks but this is not going to run programs as admin, please read the OP again and see Ian.M's comment, he is right.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod