windows找不到gpedit.msc
新建一个文件夹,名字随便,将下方代码放入新建文件夹中,然后修改后缀为bat,以管理员身份运行,会出现终端,等运行完成后关闭,就可以在win+R中输入gpedit.msc打开本地组策略编辑器
@echo off
pushd "%~dp0"
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b C:\Windows\servicing\Packages\Microsoft-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:\Windows\servicing\Packages\%%i"
pause