win10无法启动虚拟机

(1) 电脑没有Hyper-V

pushd "%~dp0"

dir /b %SystemRoot%servicingPackages*Hyper-V*.mum >hyper-v.txt

for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%servicingPackages\%%i"

del hyper-v.txt

Dism /online /enable-feature /featurename:Microsoft-Hyper-V-All /LimitAccess /ALL

(2) 电脑没有gpedit.msc

@echo off

pushd "%~dp0"

dir /b C:WindowsservicingPackagesMicrosoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt

dir /b C:WindowsservicingPackagesMicrosoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt

for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:WindowsservicingPackages\%%i"

pause
原文地址:https://www.cnblogs.com/countryboy666/p/14613929.html