创建open_hyper-v.bat
文件
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
右键-用管理员权限打开
创建close_hyper-v.bat
文件
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 /Remove-Package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /disable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL
bcdedit /set hypervisorlaunchtype off
手机扫一扫
移动阅读更方便
你可能感兴趣的文章