Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stavrossk/d23d9929b9683be8fc46749fe1297bc3 to your computer and use it in GitHub Desktop.
Save stavrossk/d23d9929b9683be8fc46749fe1297bc3 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