Skip to content

Instantly share code, notes, and snippets.

@anacondaq
Created April 13, 2026 19:11
Show Gist options
  • Select an option

  • Save anacondaq/0a48a5b192f54e067bb0e3759b379210 to your computer and use it in GitHub Desktop.

Select an option

Save anacondaq/0a48a5b192f54e067bb0e3759b379210 to your computer and use it in GitHub Desktop.
@echo off
:: Check for Admin Privileges
net session >nul 2>&1
if %errorLevel% neq 0 (
echo.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo ERROR: You MUST run this script as ADMINISTRATOR!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
pause
exit /b
)
:menu
cls
echo ======================================================
echo iGPU Performance Optimizer (Radeon 780M)
echo Memory Integrity (HVCI/VBS) Controller
echo ======================================================
echo.
:: Query current status from the Registry
for /f "tokens=3" %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v Enabled 2^>nul') do set "status=%%a"
if "%status%"=="0x1" (
echo CURRENT STATUS: [ ENABLED ] (High Security / Low iGPU Speed)
) else if "%status%"=="0x0" (
echo CURRENT STATUS: [ DISABLED ] (Maximum iGPU Performance)
) else (
echo CURRENT STATUS: [ NOT DEFINED ] (System Default)
)
echo.
echo Why this matters:
echo Turning Memory Integrity OFF can increase Radeon 780M
echo performance by up to 50%% in LLM tasks and benchmarks.
echo.
echo 1. DISABLE (Boost speed for LM Studio / Games)
echo 2. ENABLE (Standard Windows Security)
echo 3. Exit
echo.
set /p choice="Select an option (1-3): "
if "%choice%"=="1" goto disable
if "%choice%"=="2" goto enable
if "%choice%"=="3" exit
goto menu
:disable
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v Enabled /t REG_DWORD /d 0 /f
echo.
echo [!] DONE: Memory Integrity set to DISABLED.
goto reboot
:enable
reg add "HKLM\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" /v Enabled /t REG_DWORD /d 1 /f
echo.
echo [!] DONE: Memory Integrity set to ENABLED.
goto reboot
:reboot
echo.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo A SYSTEM REBOOT IS REQUIRED TO APPLY THESE CHANGES!
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo.
set /p reb="Restart computer now? (y/n): "
if /i "%reb%"=="y" shutdown /r /t 5
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment