Skip to content

Instantly share code, notes, and snippets.

@65c22
Created May 23, 2019 15:57
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 65c22/e5b7530d75e2ce1273e9f0676cdb0acb to your computer and use it in GitHub Desktop.
Save 65c22/e5b7530d75e2ce1273e9f0676cdb0acb to your computer and use it in GitHub Desktop.
You have a problem with Docker on Windows ?! Hyper-V & Virtualbox
@echo off
title Hyper V - VirtualBox
:start
set switch=false
set hv=false
set vb=false
bcdedit | find "hypervisorlaunchtype Auto" > nul && set hv=true
bcdedit | find "hypervisorlaunchtype Off" > nul && set vb=true
if %hv%==true (
if %vb%==false (
goto hv
) else (
echo ERRRRRRRRRRROR.
pause > nul
exit
)
) else (
if %vb%==true (
goto vb
) else (
echo Error
pause > nul
exit
)
)
:hv
title Using Hyper-V
echo Using Hyper-V
set /p switch="Do you want to switch for VirtualBox? (y/n) "
if %switch%==y (
bcdedit /set hypervisorlaunchtype off > nul && echo Success & title Using VirtualBox & goto restart || echo Fail to switch for VirtualBox. & pause > nul && exit
) else (
echo Bye
pause > nul
exit
)
:vb
title Using VirtualBox
echo Using VirtualBox
set /p switch="Do you want to switch for Hyper-V? (y/n) "
if %switch%==y (
bcdedit /set hypervisorlaunchtype auto > nul && echo Success & title Using Hyper-V & goto restart || echo Fail to switch for Hyper-V. & pause > nul && exit
) else (
echo Bye
pause > nul
exit
)
:restart
set /p restart="Do you want to restart now ? (y/n) "
if %restart%==y (
shutdown /r /t 0 && echo Restarting. || echo Fail to restart.
) else (
if %restart%==n (
goto start
) else (
echo Bye
pause > nul
exit
)
)
pause > nul
@ComFoxx
Copy link

ComFoxx commented May 23, 2019

You're a thief. It's my code.

PLAGIAAAAAAAAAAAAAAAAAAAAT !!!

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