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 /ALL
2.桌面上,我們找到並右鍵點擊【Hyper-V.cmd】文件圖標,在右鍵菜單中點擊:以管理員身份運行
3.然后彈出一個 用戶帳戶控制 - Windows命令處理程序 對話框,我們點擊:是。
4.然后系統自動進行Windows命令處理,我們等待處理完成以后,在最末處輸入:Y,電腦自動重啟,進行配置更新。
重啟后可以在“打開或關閉windows功能”里看到已經Hyper-V已經安裝並打上勾了。