Skip to content

Instantly share code, notes, and snippets.

@wangjiezhe
Created November 21, 2024 11:04
Show Gist options
  • Save wangjiezhe/b69bd0682e80e9ca61ee58690cbc85f8 to your computer and use it in GitHub Desktop.
Save wangjiezhe/b69bd0682e80e9ca61ee58690cbc85f8 to your computer and use it in GitHub Desktop.
使用脚本关闭VBS,可设成计划任务每次关机时自动执行(创建基本任务,触发器:特定事件,日志:系统,源:User32,事件ID:1074,勾选“使用最高权限运行”)
@echo off
REM ===========================================
mountvol X: /s
rem copy %WINDIR%\System32\SecConfig.efi X:\EFI\Microsoft\Boot\SecConfig.efi /Y
rem 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
echo.
echo.
echo.
echo.
echo =======================================================
echo 当前操作已完成,接下来请关闭此窗口并重启电脑,然后根据屏幕提示完成剩下操作。
pause > nul
echo.
echo.
@wangjiezhe
Copy link
Author

来源:修改自华为笔记本电脑如何关闭VBS(基于虚拟化的安全性)

只关闭VBS,不关闭Hyper-V。

注释掉的两行只需要执行一次即可,计划运行时不需要执行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment