Skip to content

Instantly share code, notes, and snippets.

@iscgar
Created August 12, 2016 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iscgar/3f3075647536dacc325cf29942e1ecc3 to your computer and use it in GitHub Desktop.
Save iscgar/3f3075647536dacc325cf29942e1ecc3 to your computer and use it in GitHub Desktop.
Turns Hyper-V off
@echo off
if "%1" == "" (set "BCDREC={current}") else (set "BCDREC=%1")
echo Setting Hyper-V off for %BCDREC%...
bcdedit /set %BCDREC% hypervisorlaunchtype off
if errorlevel 1 (goto fail)
echo.
echo Rebooting into No Hyper-V Mode
echo ==============================
echo Press any key to restart or CTRL-C to restart manually
pause
shutdown /r /t 0 /d p:0:0
exit /b
:fail
echo Failed to turn Hyper-V off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment