Hack Forums
[Shell] Reset Local Group Policy Settings to System Default Settings - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Reset Local Group Policy Settings to System Default Settings (/showthread.php?tid=6005103)



Reset Local Group Policy Settings to System Default Settings - Emre_ - Sep 4, 2019

This batch script will reset Local Group Policy settings to system default settings.

Code
:: This batch script created by FreeBooter

:: This batch script will reset Local Group Policy settings to system default settings

@Echo Off

Cls

REM  --> Check for permissions
Reg query "HKU\S-1-5-19\Environment"
REM --> If error flag set, we do not have admin.
if %errorlevel% NEQ 0 (
ECHO                 **************************************
ECHO                  Running Admin shell... Please wait...
ECHO                 **************************************

    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params = "%*:"=""
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
    exit /B


:gotAdmin




Cls

Rd /S /Q  %SystemRoot%\System32\GroupPolicyUsers

Rd /S /Q  %SystemRoot%\System32\GroupPolicy

gpupdate /force


Exit

Cls & Mode CON  LINES=5 COLS=48 & Color 0C & Title - WARNING -
Echo.
Echo.
Echo  YOU MUST HAVE ADMINISTRATOR RIGHTS TO CONTINUE
Pause >Nul & Exit