检查 Windows 的 UAC(用户账户控制)级别
读取注册表中 EnableLUA 和 ConsentPromptBehaviorAdmin,确认 UAC 是否被关闭或调低。
运行 `reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA`,值为 0x1 表示 UAC 已开启;再用同样方式查询 ConsentPromptBehaviorAdmin 查看提示级别。
01命令
命令
$ reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA & reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v ConsentPromptBehaviorAdmin02作用说明
UAC 是程序试图获取管理员权限时弹出的确认窗口,某些"优化"工具或恶意软件会把它关闭或调低。EnableLUA 为 0x1 表示 UAC 正在工作;ConsentPromptBehaviorAdmin 决定提示的严格程度(0 表示静默提权,5 是默认的普通提示)。用只读的 reg query 查看这两项,不会改动任何设置。
03风险
!注意: 不要为了少弹窗而关闭 UAC——它是抵御恶意软件的重要屏障。想调整提示级别,请到"控制面板 > 用户账户"里修改,而不是直接改注册表。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- Reg - Read and edit the registry依据: reg query syntax for reading the UAC values.
- How User Account Control works依据: Describes the UAC registry values under HKLM Policies\System, including EnableLUA and ConsentPromptBehaviorAdmin.
最后验证: 2026-09-18 · 分类: 安全与隐私