首页 > 编程 > C > 正文

Windows注册表中修改UAC(用户账号控制)及批处理脚本

2020-01-26 13:35:50
字体:
来源:转载
供稿:网友

注册表路径:

HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System

键说明:

ConsentPromptBehaviorAdmin:通知强度级别
EnableLUA:是否关闭UAC
PromptOnSecureDesktop:桌面是否变黑

1:UAC高

ConsentPromptBehaviorAdmin:2
EnableLUA:1
PromptOnSecureDesktop:1

2:UAC中

ConsentPromptBehaviorAdmin:5
EnableLUA:1
PromptOnSecureDesktop:1

3:UAC低

ConsentPromptBehaviorAdmin:5
EnableLUA:1
PromptOnSecureDesktop:0

4:UAC关闭

ConsentPromptBehaviorAdmin:0
EnableLUA:0
PromptOnSecureDesktop:0

================================================
彻底关闭批处理脚本:CloseUAC.bat
================================================

::::::::::::::::::::::修改注册表,获取管理员权限::::::::::::::::::@echo offecho 获取Administrator权限cacls.exe "%SystemDrive%/System Volume Information" >nul 2>nulif %errorlevel%==0 goto Adminif exist "%temp%/getadmin.vbs" del /f /q "%temp%/getadmin.vbs"echo Set RequestUAC = CreateObject^("Shell.Application"^)>"%temp%/getadmin.vbs"echo RequestUAC.ShellExecute "%~s0","","","runas",1 >>"%temp%/getadmin.vbs"echo WScript.Quit >>"%temp%/getadmin.vbs""%temp%/getadmin.vbs" /fif exist "%temp%/getadmin.vbs" del /f /q "%temp%/getadmin.vbs"exit:Adminecho 成功取得Administrator权限::::::::::::::::::::::修改注册表,关闭UAC::::::::::::::::::reg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System" /v "ConsentPromptBehaviorAdmin" /t reg_dword /d 0 /Freg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System" /v "EnableLUA" /t reg_dword /d 0 /Freg add "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System" /v "PromptOnSecureDesktop" /t reg_dword /d 0 /Fpause

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对武林网的支持。如果你想了解更多相关内容请查看下面相关链接

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选