Created
May 23, 2019 15:57
-
-
Save 65c22/e5b7530d75e2ce1273e9f0676cdb0acb to your computer and use it in GitHub Desktop.
You have a problem with Docker on Windows ?! Hyper-V & Virtualbox
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
@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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're a thief. It's my code.
PLAGIAAAAAAAAAAAAAAAAAAAAT !!!