如果启用WSA失败,就去设置里搜索“启用或关闭Windows功能”,把“Hyper-V”、“虚拟机平台”和“Windwos Powershell 2.0”打开,如果没有“Hyper-V”,就复制脚本到一个新建文本文档

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

然后将文件后缀.txt改为.cmd,然后右键以管理员身份运行脚本,然后默默等待脚本运行结束,最后的提示输入Y即可完成安装

最后修改:2024 年 02 月 14 日 05 : 58 PM