码迷,mamicode.com
首页 > 其他好文 > 详细

更改当前启动项,开关Hyper-V

时间:2018-07-11 15:58:44      阅读:388      评论:0      收藏:0      [点我收藏+]

标签:运行   bat   run   current   class   hyperv   stat   push   put   

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

 

更改当前启动项,开关Hyper-V

标签:运行   bat   run   current   class   hyperv   stat   push   put   

原文地址:https://www.cnblogs.com/Bob-wei/p/9294806.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!