Skip to content

Instantly share code, notes, and snippets.

@HotoRas
Last active January 3, 2026 10:26
Show Gist options
  • Select an option

  • Save HotoRas/5d7f1c1e4c031b8e2e956ed4c1be02c7 to your computer and use it in GitHub Desktop.

Select an option

Save HotoRas/5d7f1c1e4c031b8e2e956ed4c1be02c7 to your computer and use it in GitHub Desktop.
Grup Policy Editor Fix : Install GPEDIT.MSC to Windows Home (10 and up)

그룹 정책 편집기 설치 스크립트

그룹 정책 편집기 화면

Windows 10/11 Home에 그룹 정책 편집기를 설치합니다.
Installs Group Policy Editor to Windows 10/11 Home.

준비 및 실행

아래의 gpeditfx.bat를 아무 경로에 받아, 관리자 권한으로 실행합니다.
Download gpeditfx.bat below to any location, and run as Administrator.

NT AUTHORY\SYSTEM, TrustedInstaller 권한으로 실행할 수도 있습니다. 일부 명령이 고장날 수 있습니다.
Script can be run as NT AUTHORY\SYSTEM or TrustedInstaller. Some commands can break.

사후 과정

실행이 완료되면 실행창에 바로 gpedit.msc를 입력해 실행할 수 있으나, 재부팅을 권장합니다.
gpedit.msc can be run right after the script is done, but it's recommended to reboot your system.

@echo off
title GPEDITFX - Group Policy Editor Enabler for Windows 10 and up
:checkgpedit
if exist "C:\Windows\System32\gpedit.msc" (
echo Group Policy Editor already exists, exiting
goto end
)
:varsetup
pushd %~dp0
setlocal
set packroot=%SystemRoot%\servicing\Packages
:findgpedit
dir /b %packroot%\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~*.mum >packages.txt 2>nul
dir /b %packroot%\Microsoft-Windows-GroupPolicy-ClientTools-Package~*.mum >>packages.txt 2>nul
:rundism
for /f %%i in ('findstr /i . packages.txt 2^>nul') do dism /online /norestart /add-package:%packroot%\%%i
:endinstall
endlocal
echo Group Policy Editor is installed
echo run it with "gpedit.msc"
echo \t(shorthand for "C:\Windows\System32\mmc.exe C:\Windows\System32\gpedit.msc")
:end
timeout 10>nul 2>nul

추가 정보들 (명령어 설명)

title <your title>

title <your title>을 실행하면, 명령창의 제목을 지정할 수 있습니다. 이를 통해 현재 프로그램의 명칭이나 진행중인 작업을 표시할 수 있습니다.

pushd <directory or directory macro>

프로세스의 디렉토리를 뒤에 오는 경로로 바꿉니다. 여기서

  • %~dp0로 지정하면 스크립트가 있는 경로로 디렉토리를 변경하게 됩니다.

cd (chdir)는 작업 디렉토리를 변경하므로, 스크립트의 > <file>, >> <file>, 2>> <file> 등은 프로세스의 디렉토리로 가는 경우가 있습니다.

setlocal, endlocal

set 명령어로 지정하는 변수가 시스템 종료 시점까지 유지되지 않고 배치파일 실행 종료 시 함께 삭제되도록 하는 도스 명령입니다.

  • NT 환경에서는 의미가 없습니다. 레거시 호환을 위해 남아 있으나, 여기에서는 주 명령 구간의 표시를 위해 사용합니다.

> <path-to-file>

stdout 스트림을 새 파일로 리디렉션합니다. > std.log와 같이 사용합니다.

  • 도스 호환성으로, >와 뒤의 경로를 붙여쓸 수 있습니다.
  • 기존 파일에 추가하는 경우, >>를 사용합니다.
  • 아얘 안 띄우고 싶으면 > nul로 던지기도 합니다. nul은 어느 장치도 아닌 장치를 가리키는 매크로입니다.

2> <path-to-file>

stderr 스트림을 새 파일로 리디렉션합니다. 2> err.log와 같이 사용합니다.

  • 도스 호환성으로, 2>와 뒤의 경로를 붙여쓸 수 있습니다.
  • 기존 파일에 추가하는 경우, 2>>를 사용합니다.
  • 아얘 안 띄우고 싶으면 2> nul로 던지기도 합니다.

findstr /i <regex-like> <src-file>

주어진 src-file에서 regex-like를 검색해 리스트를 반환합니다. for /f와 함께 사용하여 foreach를 구현할 수 있습니다.

for /f %%i in <list> do

list의 각 항목을 하나하나 %%i에 할당, do 이하의 명령을 실행합니다.

  • do 이하의 명령이 두 줄 이상인 경우 (\ncommands...\n)로 리디렉션할 수 있습니다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment