Skip to content

Commit eecb731

Browse files
committed
Add Hyper-V disable and undo-disable scripts
1 parent 1913577 commit eecb731

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

DisableHyperV.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bcdedit /set hypervisorlaunchtype off
2+
dism /Online /Disable-Feature:Microsoft-Hyper-V /NoRestart
3+
dism /Online /Disable-Feature:HypervisorPlatform /NoRestart
4+
dism /Online /Disable-Feature:VirtualMachinePlatform /NoRestart
5+
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity /v Enabled /t REG_DWORD /d 0 /f
6+
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity /v WasEnabledBy /t REG_DWORD /d 2 /f
7+
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard /v EnableVirtualizationBasedSecurity /t REG_DWORD /d 0 /f

UndoDisableHyperV.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bcdedit /set hypervisorlaunchtype auto
2+
dism /Online /Enable-Feature:HypervisorPlatform /NoRestart
3+
dism /Online /Enable-Feature:VirtualMachinePlatform /NoRestart
4+
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity /v Enabled /t REG_DWORD /d 1 /f
5+
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity /v WasEnabledBy /t REG_DWORD /d 2 /f
6+
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard /v EnableVirtualizationBasedSecurity /t REG_DWORD /d 1 /f

0 commit comments

Comments
 (0)