将以下代码复制到文本文档,并修改后缀为bat,然后以管理员运行。
@echo off
pushd "%~dp0"
dir /b %systemroot%\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >gp.txt
dir /b %systemroot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>gp.txt
for /f %%i in ('findstr /i . gp.txt 2^>nul') do dism /online /norestart /add-package:"%systemroot%\servicing\Packages\%%i"
pause
说明:通过dir命令遍历系统盘servicing目录,寻找组策略的配置包,找到后写入到gp.txt文件,然后通过dism命令来安装组策略包。
参考:https://www.zhihu.com/question/41745930
标签:文件,Packages,gp,Windows,gpedit,servicing,systemroot%,txt,msc From: https://www.cnblogs.com/yuyanc/p/17180206.html