Enable and disable hyper-V service on Windows

Both Hyper-V and Virtual Box are excellent virtualization tools.  Unfortunately, they compete for the BIOS virtualization feature.  I’ve been using the HoloLens emulator recently which requires Hyper-V.

I created some simple batch files to easily enable/disable Hyper-V as I move to/from the HoloLens emulator.  Create two new files  (add the contents specified below) , right-click and run as Administrator, a  reboot is required.

hyperv-enable.bat

@echo off
echo "NOTE: you must run this script at administrator level"
bcdedit /set hypervisorlaunchtype auto
echo "press enter to reboot ..."
pause
shutdown /r

hyperv-disable.bat

@echo off
echo "NOTE: you must run this script at administrator level"
bcdedit /set hypervisorlaunchtype off
echo "press enter to reboot ..."
pause
shutdown /r

to switch hyper-V on/off simply right-click on the bat file and select ‘run as administrator’ … after a reboot, the hyper-V service will be updated.

Leave a Reply to Anonymous Cancel reply