Answers:
在提升的命令提示符中输入以下内容:
禁用:
bcdedit /set hypervisorlaunchtype off
启用:
bcdedit /set hypervisorlaunchtype auto
(摘自评论-重新开始生效)
该命令有效
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All
运行它,然后同意在出现提示时重新启动计算机。
我在Windows 10上的提升权限的PowerShell中运行了它,但它也应在Win 8或7上运行。
您可以在管理提示下进行Windows 10配置,带有和不带有Hyper-V,如下所示:
bcdedit /copy {current} /d "Windows 10 no Hyper-V"
查找刚刚创建的“ Windows 10 no Hyper-V”引导程序的新ID,例如。{094a0b01-3350-11e7-99e1-bc5ec82bc470}
bcdedit /set {094a0b01-3350-11e7-99e1-bc5ec82bc470} hypervisorlaunchtype Off
重新启动后,您可以在启动时选择是否装有Hyper-V的Windows 10
{current}
和{GUID}
之间放置以下内容" "
:"{current}"
命令行:
dism /online /disable-feature /featurename:microsoft-hyper-v-all
如果有人得到:
我们无法完成更新,正在撤消更改
尝试禁用Hyper-V之后,请尝试从“设备管理器”->“网络适配器”中卸载Hyper-V虚拟网络适配器。
以管理员身份打开命令提示符并运行以下命令:
bcdedit /set {current} hypervisorlaunchtype off
重新引导后,仍会安装Hyper-V,但Hypervisor不再运行。现在,您可以毫无问题地使用VMware。
如果再次需要Hyper-V,请以管理员身份打开命令提示符并运行以下命令:
bcdedit /set {current} hypervisorlaunchtype auto
bcdedit /set {current} ...
over 有什么区别/优势bcdedit /set ...
吗?
您可以使用我的脚本。将代码行粘贴到记事本并另存为vbs(例如switch_hypervisor.vbs)
Option Explicit
Dim backupfile
Dim record
Dim myshell
Dim appmyshell
Dim myresult
Dim myline
Dim makeactive
Dim makepassive
Dim reboot
record=""
Set myshell = WScript.CreateObject("WScript.Shell")
If WScript.Arguments.Length = 0 Then
Set appmyshell = CreateObject("Shell.Application")
appmyshell.ShellExecute "wscript.exe", """" & WScript.ScriptFullName & """ RunAsAdministrator", , "runas", 1
WScript.Quit
End if
Set backupfile = CreateObject("Scripting.FileSystemObject")
If Not (backupfile.FileExists("C:\bcdedit.bak")) Then
Set myresult = myshell.Exec("cmd /c bcdedit /export c:\bcdedit.bak")
End If
Set myresult = myshell.Exec("cmd /c bcdedit")
Do While Not myresult.StdOut.AtEndOfStream
myline = myresult.StdOut.ReadLine()
If myline="The boot configuration data store could not be opened." Then
record=""
exit do
End If
If Instr(myline, "identifier") > 0 Then
record=""
If Instr(myline, "{current}") > 0 Then
record="current"
End If
End If
If Instr(myline, "hypervisorlaunchtype") > 0 And record = "current" Then
If Instr(myline, "Auto") > 0 Then
record="1"
Exit Do
End If
If Instr(myline, "On") > 0 Then
record="1"
Exit Do
End If
If Instr(myline, "Off") > 0 Then
record="0"
Exit Do
End If
End If
Loop
If record="1" Then
makepassive = MsgBox ("Hypervisor status is active, do you want set to passive? ", vbYesNo, "Hypervisor")
Select Case makepassive
Case vbYes
myshell.run "cmd.exe /C bcdedit /set hypervisorlaunchtype off"
reboot = MsgBox ("Hypervisor chenged to passive; Computer must reboot. Reboot now? ", vbYesNo, "Hypervisor")
Select Case reboot
Case vbYes
myshell.run "cmd.exe /C shutdown /r /t 0"
End Select
Case vbNo
MsgBox("Not Changed")
End Select
End If
If record="0" Then
makeactive = MsgBox ("Hypervisor status is passive, do you want set active? ", vbYesNo, "Hypervisor")
Select Case makeactive
Case vbYes
myshell.run "cmd.exe /C bcdedit /set hypervisorlaunchtype auto"
reboot = MsgBox ("Hypervisor changed to active; Computer must reboot. Reboot now?", vbYesNo, "Hypervisor")
Select Case reboot
Case vbYes
myshell.run "cmd.exe /C shutdown /r /t 0"
End Select
Case vbNo
MsgBox("Not Changed")
End Select
End If
If record="" Then
MsgBox("Error: record can't find")
End If
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
和dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
,但仍然不知道如何bcdedit
工作。