Vincent88
Active Member
- Joined
- Mar 5, 2021
- Messages
- 382
- Office Version
- 2019
- Platform
- Windows
- Mobile
Hi Guys, How to modify a batch script to toggle between the two values when execute. Any help would be much appreciated.
VBA Code:
@echo off
for /F "skip=2 tokens=2*" %%A in ('reg query "HKLM\Software\microsoft\windows\CurrentVersion\Policies\System" /v "EnableLUA"') DO (Echo %%B)
If %%B==0x0 (
reg add HKLM\Software\microsoft\windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /D 1 /f
echo 1 %errorlevel%
) else (
reg add HKLM\Software\microsoft\windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /D 0 /f
echo 0 %errorlevel%
)
for /F "skip=2 tokens=2*" %%A in ('reg query "HKLM\Software\microsoft\windows\CurrentVersion\Policies\System" /v "EnableLUA"') DO (Echo %%B)