Skip to content

Instantly share code, notes, and snippets.

@ogero
Created August 3, 2017 14:24
Show Gist options
  • Save ogero/22e974514c4e613958781302a7385e5e to your computer and use it in GitHub Desktop.
Save ogero/22e974514c4e613958781302a7385e5e to your computer and use it in GitHub Desktop.
Toggle Hyper-V util (docker vs avd-haxm)
@echo off
:InputToggle
echo Select hypervisor launch tipe (auto/off):(A/O)
set INPUT=
set /P INPUT=Type input: %=%
If /I "%INPUT%"=="a" goto auto
If /I "%INPUT%"=="o" goto off
echo Incorrect input & goto InputToggle
:auto
bcdedit /set hypervisorlaunchtype auto
goto InputReboot
:off
bcdedit /set hypervisorlaunchtype off
goto InputReboot
:InputReboot
echo Do you want to reboot now?(Y/N)
set INPUT=
set /P INPUT=Type input: %=%
If /I "%INPUT%"=="y" goto rebootyes
If /I "%INPUT%"=="n" goto rebootno
echo Incorrect input & goto InputReboot
:rebootyes
echo Done. Rebooting now to apply changes.
shutdown.exe /r /t 08
goto end
:rebootno
echo Done. Reboot manually to apply changes.
goto end
:end
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment