复制脚本到一个新建文本文档

@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

然后将文件后缀.txt改为.cmd,然后右键以管理员身份运行脚本,然后默默等待脚本运行结束,最后再在运行中输入gpedit.msc即可成功打开本地组策略编辑器