switch-HyperV.bat

 1 @echo off
 2 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\SYSTEM" >nul 2>nul
 3 if %errorlevel%==0 goto :start
 4 
 5 chcp 936>nul
 6 echo Please use administrator account to run.
 7 echo 请以管理员身份运行。
 8 pause
 9 goto :end
10 
11 :start
12 pushd "%~dp0"
13 :menu
14 echo MENU
15 echo 1. Set current boot item: hypervisorlaunchtype Auto
16 echo 2. Set current boot item: hypervisorlaunchtype Off
17 echo Q. Exit
18 echo.
19 echo Current status:
20 bcdedit /enum {current}|findstr hypervisorlaunchtype
21 echo.
22 set /p input=Please input: 
23 if "%input%"=="1" goto :auto
24 if "%input%"=="2" goto :off
25 if /i "%input%"=="q" goto :end
26 echo.
27 goto :menu
28 :auto
29 bcdedit /set {current} hypervisorlaunchtype auto
30 goto :menu
31 :off
32 bcdedit /set {current} hypervisorlaunchtype off
33 goto :menu
34 :end
35 popd

 

相关文章:

  • 2021-12-26
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-02-09
  • 2021-09-27
  • 2022-12-23
  • 2021-12-15
  • 2020-11-01
  • 2022-12-23
  • 2021-11-04
相关资源
相似解决方案