Skip to content

Instantly share code, notes, and snippets.

@jonpulsifer
Last active May 11, 2024 13:55
Show Gist options
  • Star 35 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save jonpulsifer/373ba10ac03e13885b0f8dfe1946882a to your computer and use it in GitHub Desktop.
Save jonpulsifer/373ba10ac03e13885b0f8dfe1946882a to your computer and use it in GitHub Desktop.
Virtualization must be disabled to use CS:GO anti-cheat clients like FACEIT and ESEA, but I like to use WSL2 and Docker, and this script helps me do that
@echo off
echo Virtualization must be disabled to use anti-cheat clients like FACEIT and ESEA
echo.
net session >nul 2>&1
if %ERRORLEVEL% EQU 0 goto :chchchchoices
echo This script requires elevated privileges. Re-run as Administrator to continue
goto :exit
:chchchchoices
echo.
echo Press 1 to ENABLE virtualization
echo Press 2 to DISABLE virtualization
echo Press 3 to ENABLE Windows Subsystem for Linux (WSL)
echo Press 4 to ENABLE WSL 2
echo Press 9 to exit
choice /C 12349
if %ERRORLEVEL% EQU 1 goto :enablevirt
if %ERRORLEVEL% EQU 2 goto :disablevirt
if %ERRORLEVEL% EQU 3 goto :enablewsl
if %ERRORLEVEL% EQU 4 goto :enablewsl2
if %ERRORLEVEL% EQU 5 goto :exit
:enablevirt
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
echo.
echo Virtualization has been enabled. Restart for changes to take effect.
goto :chchchchoices
:disablevirt
dism.exe /online /disable-feature /featurename:VirtualMachinePlatform /norestart
echo.
echo Virtualization has been disabled. Restart for changes to take effect.
goto :restart
:enablewsl
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
echo.
echo Windows Subsystem for Linux version 1 has been installed. To update to version 2, a restart is required.
goto :restart
:enablewsl2
wsl --set-default-version 2
echo.
if %ERRORLEVEL% EQU 0 (echo WSL2 is now the default version) else (echo "Something went wrong")
goto :chchchchoices
:restart
echo.
echo Restart now?
choice /C YN
if %ERRORLEVEL% EQU 1 goto :restartmeow
if %ERRORLEVEL% EQU 2 goto :exit
:restartmeow
shutdown /r /t 0
:exit
pause
@mrzarkovic
Copy link

Thanks mate! GGWP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment