大多数用户通过在注册表中添加其他谓词来自定义右键单击菜单,以便启动程序或脚本。Windows 7(及更高版本)允许您为静态上下文菜单项添加 UAC 盾图标。如果添加到右键单击菜单的谓词将启动默认情况下运行提升的程序,则建议添加 UAC 屏蔽图标,以便用户知道任务需要提升。

例如,以 为例。REG 文件(也称为注册条目)。右键单击 时,REG 文件,你会看到”合并”命令,该命令启动 Regedit.exe(当您以管理员身份登录时始终运行提升),并将文件名作为参数。因此,让我们添加一个 UAC 图标到 Merge 命令的 REG 文件类型,因为它运行Regedit.exe提升
如何为 Windows 中的右键单击菜单项管理员运行图标 - 图1
通过在静态谓词上创建名为HasLUAShield (REG_SZ) 的注册表值,您可以将 UAC 屏蔽图标添加到右键单击菜单中的相应项中。使用以下步骤:
单击”开始”,键入 Regedit.exe

导航到以下分支:
HKEY_CLASSES_ROOT\regfile\shell\open
在右窗格中,创建名为HasLUAshield的字符串值(REG_SZ)

如何为 Windows 中的右键单击菜单项管理员运行图标 - 图2
退出注册表编辑器。
右键单击 。REG 文件,你会看到合并命令的 UAC屏蔽图标
如何为 Windows 中的右键单击菜单项管理员运行图标 - 图3
https://www.winhelponline.com/blog/add-uac-shield-icon-right-click-context-menu-windows-7/

https://www.itread01.com/content/1542692248.html

新增到登錄檔

將下面命令儲存為reg檔案:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=”Open command window here as Administrator”
“HasLUAShield”=””

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=”cmd.exe /s /k pushd \”%V\””

[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
@=”Open command window here as Administrator”
“HasLUAShield”=””

[HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
@=”cmd.exe /s /k pushd \”%V\””

[-HKEY_CLASSES_ROOT\Drive\shell\runas]

[HKEY_CLASSES_ROOT\Drive\shell\runas]
@=”Open command window here as Administrator”
“HasLUAShield”=””

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@=”cmd.exe /s /k pushd \”%V\””

[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas]

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas]
“HasLUAShield”=””
@=”Open command window here as Administrator”

[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas\command]
儲存 檔名為 Add_Open_Command_Window_Here_as_Administrator.reg
然後雙擊執行就可以了。

解除安裝

類似上面的,執行下面登錄檔命令就可以了:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

[-HKEY_CLASSES_ROOT\Directory\Background\shell\runas]

[-HKEY_CLASSES_ROOT\Drive\shell\runas]

[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\runas]
~

補充:
1、HasLUAShield   By creating a registry value named HasLUAShield (REG_SZ) on the static verb, you can add the UAC shield icon to the corresponding item in the right-click menu. 參考:https://www.winhelponline.com/blog/add-uac-shield-icon-right-click-context-menu-windows-7/
2、pushd   The Pushd command stores the current directory for use by the popd command, and then changes to the specified directory.  參考:http://www.windowscommandline.com/pushd/

https://www.wukong.com/question/6543499948711739662/

WIN10 EnableLUA是WIN10注册表中的一个键值,它所在的位置是:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system
他的常用键值为0和1两种,作用分别是:当键值为1的时候,打开.exe文件也就是应用程序的时候,默认是使用普通用户的权限去打开的,而当你设置成0的时候,默认是用管理员的权限去打开的,不会有限制,他们的区别就是权限。
打开注册表,默认值为1
如何为 Windows 中的右键单击菜单项管理员运行图标 - 图4