Created
September 5, 2016 15:20
-
-
Save abdulhadad/f9ae06c1c588d8e6ede86e2bbfe1c4fa to your computer and use it in GitHub Desktop.
HyperV Switch On/Off for VMWare?Virtualbox or HyperV Environtment
This file contains hidden or 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 | |
NET FILE 1>NUL 2>NUL | |
if '%errorlevel%' == '0' ( goto gotPrivileges | |
) | |
echo "Run this script as Administrator | |
pause | |
exit /b | |
:gotPrivileges | |
set _show_lauchtype=bcdedit /enum {default} | |
rem see if device support hotspot | |
for /f "tokens=2" %%a in ('%_show_lauchtype% ^|find "hypervisorlaunchtype"') do @set _lauchtype=%%a | |
if "%_lauchtype%"=="Auto" ( | |
echo setting off hyper-v | |
bcdedit /set hypervisorlaunchtype Off | |
) | |
if "%_lauchtype%"=="Off" ( | |
echo setting on hyper-v | |
bcdedit /set hypervisorlaunchtype Auto | |
) | |
echo Enter to restart | |
pause | |
shutdown /r /t 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment