Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save john-clark/40ced8220986043ad5dd6d3abc31c962 to your computer and use it in GitHub Desktop.
Save john-clark/40ced8220986043ad5dd6d3abc31c962 to your computer and use it in GitHub Desktop.
After uninstalling wsl the service still starts!? Service can't be disabled via control panel. Use this to get access back to VT-x
@echo off
net.exe session 1>NUL 2>NUL || (Echo This script requires elevated rights. & Exit /b 1)
set key=HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WslService
set val=Start
set new=0x0
set old=
for /F "skip=2 tokens=3" %%r in ('reg query %key% /v %val%') do set old=%%r
echo old=%old%
echo.
echo disabling wsl auto start - after reboot
reg add %key% /v %val% /d %new% /f
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment