1.新建记事本,将代码拷贝到记事本并命名为:hyper-v.cmd
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /AL
2.右键-以管理员身份运行
3.安装完成后会提示是否重启Y/N,选择Y回车重启即可。