Windows registry modifies UAC of user account control and batch scripts
- 2020-06-12 10:13:03
- OfStack
Registry path:
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System
Key:
[
ConsentPromptBehaviorAdmin: Notification intensity level
EnableLUA: Whether to turn off UAC
PromptOnSecureDesktop: Is the desktop black
1: high UAC
[
ConsentPromptBehaviorAdmin: 2
EnableLUA: 1.
PromptOnSecureDesktop: 1.
2: UAC
[
ConsentPromptBehaviorAdmin: 5
EnableLUA: 1.
PromptOnSecureDesktop: 1.
3: UAC is low
[
ConsentPromptBehaviorAdmin: 5
EnableLUA: 1.
PromptOnSecureDesktop: 0
4: UAC shut down
[
ConsentPromptBehaviorAdmin: 0
EnableLUA: 0
PromptOnSecureDesktop: 0
================================================
Turn off the batch script completely: ES68en.bat
================================================
:::::::::::::::::::::: Modify the registry to obtain administrator privileges ::::::::::::::::::
@echo off
echo To obtain Administrator permissions
cacls.exe "%SystemDrive%\System Volume Information" >nul 2>nul
if %errorlevel%==0 goto Admin
if 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" /f
if exist "%temp%\getadmin.vbs" del /f /q "%temp%\getadmin.vbs"
exit
:Admin
echo Success with Administrator permissions
:::::::::::::::::::::: Modify the registry, close UAC::::::::::::::::::
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "ConsentPromptBehaviorAdmin" /t reg_dword /d 0 /F
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t reg_dword /d 0 /F
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "PromptOnSecureDesktop" /t reg_dword /d 0 /F
pause
conclusion