Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eplord/97b2faf028e7580272736e5b9fde662d to your computer and use it in GitHub Desktop.
Save eplord/97b2faf028e7580272736e5b9fde662d to your computer and use it in GitHub Desktop.
@echo off
IF NOT EXIST %WINDIR%\System32\GroupPolicy goto next
echo Deleting GroupPolicy folder...
RD /S /Q "%WINDIR%\System32\GroupPolicy" || goto error
echo.
:next
IF NOT EXIST %WINDIR%\System32\GroupPolicyUsers goto next2
echo Deleting GroupPolicyUsers folder...
RD /S /Q "%WINDIR%\System32\GroupPolicyUsers" || goto error
echo.
:next2
gpupdate /force
pause
exit
:error
echo.
echo An unexpected error has occurred. Have you opened the program as an administrator (right click, run as administrator)?
echo.
pause
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment