Last active
May 26, 2021 20:20
-
-
Save sathonay/0815d8def929d525ff836e2cd6971079 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:start | |
@echo off | |
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) | |
set /p var=yes(y) to enable hyper-v, no(n) to disable hyper-v: | |
if /i %var% == y goto enable | |
if /i %var% == yes goto enable | |
if /i %var% == n goto disable | |
if /i %var% == no goto disable | |
cls | |
goto start | |
:enable | |
bcdedit /set hypervisorlaunchtype auto | |
goto end | |
:disable | |
bcdedit /set hypervisorlaunchtype off | |
goto end | |
:end | |
set /p var=no(n) cancel restart and exit or press any key or enter to restart your computer: | |
if /i %var% == n exit | |
if /i %var% == no exit | |
shutdown /r /t 0 | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:start | |
@echo off | |
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b) | |
echo !!! Your computer will restart automatically to correctly enable or disable hyper-v!!! | |
set /p var=yes(y) to enable hyper-v, no(n) to disable hyper-v: | |
if /i %var% == y goto enable | |
if /i %var% == yes goto enable | |
if /i %var% == n goto disable | |
if /i %var% == no goto disable | |
cls | |
goto start | |
:enable | |
bcdedit /set hypervisorlaunchtype auto | |
goto end | |
:disable | |
bcdedit /set hypervisorlaunchtype off | |
goto end | |
:end | |
echo !!! your computer will restart when you will press a key, exist here to cancel the restart!!! | |
pause | |
shutdown /r /t 0 | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment