一 新建一個(gè)文本文件,將下面的代碼復(fù)制
@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命令遍歷系統(tǒng)盤servicing目錄笔宿,尋找組策略的配置包戚揭,找到后寫入到gp.txt文件扯饶,然后通過dism命令來安裝組策略包