脚本 1:禁用 Hyper-V(管理员运行)
新建文本文档,粘贴下面代码,保存为 关闭 Hyper-V.bat,右键以管理员身份运行
@echo off
title 关闭Hyper-V 适配VMware
echo 正在禁用Hyper-V、虚拟机平台、内核隔离虚拟化...
dism /online /disable-feature /featurename:Microsoft-Hyper-V-All /norestart
dism /online /disable-feature /featurename:VirtualMachinePlatform /norestart
dism /online /disable-feature /featurename:WindowsHypervisorPlatform /norestart
bcdedit /set hypervisorlaunchtype off
echo 操作完成!请重启电脑生效
pause
脚本 2:恢复开启 Hyper-V(以后要用 WSL/Docker 再用)
保存为 开启 Hyper-V.bat,同样管理员运行
@echo off
title 开启Hyper-V
echo 正在开启Hyper-V相关组件...
dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /norestart
dism /online /enable-feature /featurename:VirtualMachinePlatform /norestart
dism /online /enable-feature /featurename:WindowsHypervisorPlatform /norestart
bcdedit /set hypervisorlaunchtype auto
echo 操作完成!请重启电脑生效
pause

评论列表: