Gpedit.msc Activator (только для Windows 10)

Moxito

Пользователь
Сообщения
350
Реакции
33
Баллы
33
Gpedit.msc Activator - скрипт для активации групповой политики на системах Windows 10 (кроме professional версий, ибо там это уже есть).
Автор: Moxito & ITechTics
Версия в этом посте: 1.0


CMD/BATCH:
@echo off
chcp 1251>nul
pushd "%~dp0">nul
set "ver=1.0"
set "sysx=0"
set /a num=%random% %%10000 +1
echo [Start] > "Temp.txt"
echo %processor_architecture% | findstr "64"
if %errorlevel% EQU 0 (
    set "sysx=64"
) else (
    set "sysx=32"
)
if exist "data\32bitsys.cmd" (
    REM fake komanda dlya prodolgeniya
) else (
    echo File not found!
    ping -n 3 localhost>nul
    exit /b 1
)
if exist "data\64bitsys.cmd" (
    REM fake komanda dlya prodolgeniya
) else (
    echo File not found!
    ping -n 3 localhost>nul
    exit /b 1
)
if exist "data\setup.exe" (
    REM fake komanda dlya prodolgeniya
) else (
    echo File not found!
    ping -n 3 localhost>nul
    exit /b 1
)
title Gpedit.msc Activator %ver%
echo Gpedit.msc Activator %ver%
echo Author: Moxito
echo.
echo The script allows you activate "Local Group Policy Editor" (gpedit.msc) at Windows 10 Home and other subsystems.
echo.
net session >nul 2>&1
if %errorLevel% EQU 0 (
    REM fake komanda dlya prodolgeniya
) else (
    echo Administrator rights not detected!
    ping -n 3 localhost>nul
    exit /b 1
)
echo Starting script in 5 seconds...
ping -n 6 localhost>nul
echo Script started!
Reg Query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /V "ProductName" | findstr "Windows 10" >nul 2>&1
if %errorLevel% EQU 0 (
    REM fake cmd для продолжения
) else (
    echo Your system isn't Windows 10!
    ping -n 3 localhost>nul
    exit /b 1
)
start "" "data\setup.exe"
ping -n 6 localhost>Nul
echo [End 1/4] >> "Temp.txt"
if "%sysx%"=="64" (
    Start "" CMD /K "data\64bitsys.cmd"
) else (
    Start "" CMD /K "data\32bitsys.cmd"
)
ping -n 6 localhost>Nul
echo [End 2/4] >> "Temp.txt"
del /q /s List.txt>nul
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >> Temp.txt
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >> Temp.txt
for /f %%i in ('findstr /i . Temp.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i" echo [End 3/3] >> "Temp.txt"
echo [End 3/4] >> "Temp.txt"
ping -n 6 localhost>Nul
@powershell "$x=(New-Object -ComObject WScript.Shell).CreateShortcut('%USERPROFILE%\Desktop\Gpedit.msc.lnk');$x.TargetPath='%windir%\GPBAK\gpedit.msc';$x.HotKey='CTRL+ALT+F';$x.Save()
echo [End 4/4] >> "Temp.txt"
echo Script finished, now you can use gpedit.msc!
echo Link created on Desktop!
echo On new build 1809 you can't find "gpedit.msc" in Windows Search.
echo Folder with "gpedit.msc": %windir%\GPBAK\gpedit.msc
echo Exiting in 5 seconds...
ping -n 6 localhost>nul
exit /b 0
CMD/BATCH:
@echo off
echo x64
takeown /f %WinDir%\SysWOW64\gpedit.dll
icacls %WinDir%\SysWOW64\gpedit.dll /grant:r "%username%":f
takeown /f %WinDir%\SysWOW64\fde.dll
icacls %WinDir%\SysWOW64\fde.dll /grant:r "%username%":f
takeown /f %WinDir%\SysWOW64\gptext.dll
icacls %WinDir%\SysWOW64\gptext.dll /grant:r "%username%":f
echo.
echo.

takeown /f %WinDir%\SysWOW64\appmgr.dll
icacls %WinDir%\SysWOW64\appmgr.dll /grant:r "%username%":f
takeown /f %WinDir%\SysWOW64\fdeploy.dll
icacls %WinDir%\SysWOW64\fdeploy.dll /grant:r "%username%":f

IF NOT EXIST %WinDir%\SysWOW64\GPBAK\NUL MKDIR %WinDir%\SysWOW64\GPBAK
takeown /f %WinDir%\SysWOW64\GPBAK\*
icacls %WinDir%\SysWOW64\GPBAK\* /grant:r "%username%":f

IF EXIST %WinDir%\SysWOW64\gpedit.dll copy %WinDir%\SysWOW64\gpedit.dll %WinDir%\SysWOW64\GPBAK\gpedit.dll
IF EXIST %WinDir%\SysWOW64\fde.dll copy %WinDir%\SysWOW64\fde.dll %WinDir%\SysWOW64\GPBAK\fde.dll
IF EXIST %WinDir%\SysWOW64\gptext.dll copy %WinDir%\SysWOW64\gptext.dll %WinDir%\SysWOW64\GPBAK\gptext.dll
IF EXIST %WinDir%\SysWOW64\appmgr.dll copy %WinDir%\SysWOW64\appmgr.dll %WinDir%\SysWOW64\GPBAK\appmgr.dll
IF EXIST %WinDir%\SysWOW64\fdeploy.dll copy %WinDir%\SysWOW64\fdeploy.dll %WinDir%\SysWOW64\GPBAK\fdeploy.dll
IF EXIST %WinDir%\SysWOW64\gpedit.msc copy %WinDir%\SysWOW64\gpedit.msc %WinDir%\SysWOW64\GPBAK\gpedit.msc

copy gpedit.dll %WinDir%\SysWOW64\gpedit.dll
copy fde.dll %WinDir%\SysWOW64\fde.dll
copy gptext.dll %WinDir%\SysWOW64\gptext.dll
copy appmgr.dll %WinDir%\SysWOW64\appmgr.dll
copy fdeploy.dll %WinDir%\SysWOW64\fdeploy.dll
copy gpedit.msc %WinDir%\SysWOW64\gpedit.msc

IF NOT EXIST %WinDir%\SysWOW64\GroupPolicy\NUL MKDIR %WinDir%\SysWOW64\GroupPolicy
IF NOT EXIST %WinDir%\SysWOW64\GroupPolicy\adm\NUL MKDIR %WinDir%\SysWOW64\GroupPolicy\adm

copy system.adm %WinDir%\SysWOW64\GroupPolicy\Adm\system.adm
copy inetres.adm %WinDir%\SysWOW64\GroupPolicy\Adm\inetres.adm
copy conf.adm %WinDir%\SysWOW64\GroupPolicy\Adm\conf.adm
copy wmplayer.adm %WinDir%\SysWOW64\GroupPolicy\Adm\wmplayer.adm
copy wuau.adm %WinDir%\SysWOW64\GroupPolicy\Adm\wuau.adm

regsvr32 /s %WinDir%\SysWOW64\gpedit.dll
regsvr32 /s %WinDir%\SysWOW64\fde.dll
regsvr32 /s %WinDir%\SysWOW64\gptext.dll
regsvr32 /s %WinDir%\SysWOW64\appmgr.dll
regsvr32 /s %WinDir%\SysWOW64\fdeploy.dll
CMD/BATCH:
@echo off
echo x86
takeown /f %WinDir%\System32\gpedit.dll
icacls %WinDir%\System32\gpedit.dll /grant:r "%username%":f
takeown /f %WinDir%\System32\fde.dll
icacls %WinDir%\System32\fde.dll /grant:r "%username%":f
takeown /f %WinDir%\System32\gptext.dll
icacls %WinDir%\System32\gptext.dll /grant:r "%username%":f
echo.
echo.

takeown /f %WinDir%\System32\appmgr.dll
icacls %WinDir%\System32\appmgr.dll /grant:r "%username%":f
takeown /f %WinDir%\System32\fdeploy.dll
icacls %WinDir%\System32\fdeploy.dll /grant:r "%username%":f

IF NOT EXIST %WinDir%\System32\GPBAK\NUL MKDIR %WinDir%\System32\GPBAK
takeown /f %WinDir%\System32\GPBAK\*
icacls %WinDir%\System32\GPBAK\* /grant:r "%username%":f

IF EXIST %WinDir%\System32\gpedit.dll copy %WinDir%\System32\gpedit.dll %WinDir%\System32\GPBAK\gpedit.dll
IF EXIST %WinDir%\System32\fde.dll copy %WinDir%\System32\fde.dll %WinDir%\System32\GPBAK\fde.dll
IF EXIST %WinDir%\System32\gptext.dll copy %WinDir%\System32\gptext.dll %WinDir%\System32\GPBAK\gptext.dll
IF EXIST %WinDir%\System32\appmgr.dll copy %WinDir%\System32\appmgr.dll %WinDir%\System32\GPBAK\appmgr.dll
IF EXIST %WinDir%\System32\fdeploy.dll copy %WinDir%\System32\fdeploy.dll %WinDir%\System32\GPBAK\fdeploy.dll
IF EXIST %WinDir%\System32\gpedit.msc copy %WinDir%\System32\gpedit.msc %WinDir%\System32\GPBAK\gpedit.msc

copy gpedit.dll %WinDir%\System32\gpedit.dll
copy fde.dll %WinDir%\System32\fde.dll
copy gptext.dll %WinDir%\System32\gptext.dll
copy appmgr.dll %WinDir%\System32\appmgr.dll
copy fdeploy.dll %WinDir%\System32\fdeploy.dll
copy gpedit.msc %WinDir%\System32\gpedit.msc

IF NOT EXIST %WinDir%\System32\GroupPolicy\NUL MKDIR %WinDir%\System32\GroupPolicy
IF NOT EXIST %WinDir%\System32\GroupPolicy\adm\NUL MKDIR %WinDir%\System32\GroupPolicy\adm

copy system.adm %WinDir%\System32\GroupPolicy\Adm\system.adm
copy inetres.adm %WinDir%\System32\GroupPolicy\Adm\inetres.adm
copy conf.adm %WinDir%\System32\GroupPolicy\Adm\conf.adm
copy wmplayer.adm %WinDir%\System32\GroupPolicy\Adm\wmplayer.adm
copy wuau.adm %WinDir%\System32\GroupPolicy\Adm\wuau.adm

regsvr32 /s %WinDir%\System32\gpedit.dll
regsvr32 /s %WinDir%\System32\fde.dll
regsvr32 /s %WinDir%\System32\gptext.dll
regsvr32 /s %WinDir%\System32\appmgr.dll
regsvr32 /s %WinDir%\System32\fdeploy.dll
Основа: InnoSetup
Внутренность: файлы .BAT, файл "gpedit.msc" и нужные для него файлы, административные шаблоны.

ВНИМАНИЕ!
Автор не несёт ответственность за действия этой программы!
Если Вы обнаружили ошибку, недоработку или хотите помочь с разработкой - отправьте личное сообщение автору (Moxito).
Спасибо за понимание!
 

Вложения

Moxito

Пользователь
Сообщения
350
Реакции
33
Баллы
33
Архив был восстановлен. 10.02.2019 18:24
 
Сверху Снизу