Skip to content

Instantly share code, notes, and snippets.

@stgnet
Created July 17, 2019 18:53
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save stgnet/ca49a273a01ca2c99cd3c3a4311276f9 to your computer and use it in GitHub Desktop.
Save stgnet/ca49a273a01ca2c99cd3c3a4311276f9 to your computer and use it in GitHub Desktop.
@echo off
net session >nul 2>&1
if %errorLevel% == 0 (
@echo on
mountvol X: /s
copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "\EFI\Microsoft\Boot\SecConfig.efi"
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
mountvol X: /d
bcdedit /set hypervisorlaunchtype off
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V-All
SHUTDOWN -r -t 5
) else (
echo Please run as administrator
pause
exit /b
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment