Windows家庭版打开或关闭Hyper-V

打开hyper-v

创建open_hyper-v.bat文件

pushd "%~dp0"dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txtfor /f %%i in (‘findstr /i . hyper-v.txt 2^>nul‘) do dism /online /norestart /add-Package:"%SystemRoot%\servicing\Packages\%%i"del hyper-v.txtDism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

右键-用管理员权限打开

关闭hyper-v

创建close_hyper-v.bat文件

pushd "%~dp0"dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txtfor /f %%i in (‘findstr /i . hyper-v.txt 2^>nul‘) do dism /online /norestart /Remove-Package:"%SystemRoot%\servicing\Packages\%%i"del hyper-v.txtDism /online /disable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALLbcdedit /set hypervisorlaunchtype off

相关文章