Skip to content

Instantly share code, notes, and snippets.

@focusmade
Last active October 3, 2020 03:00
Show Gist options
  • Save focusmade/34d5f036e312dddb0fded88fa53d019b to your computer and use it in GitHub Desktop.
Save focusmade/34d5f036e312dddb0fded88fa53d019b to your computer and use it in GitHub Desktop.
ECHO OFF
CLS
:MAIN
CLS
color 0e
TITLE gpupdate script with options
MODE con cols=55 lines=20
ECHO 1 - gpupdate /force /sync /boot
ECHO 2 - gpupdate /force
ECHO 3 - gpupdate
ECHO 4 - gpresult
ECHO.
ECHO 0 - Exit/Quit
SET /P M=enter:
IF %M%==1 GOTO 1
IF %M%==2 GOTO 2
IF %M%==3 GOTO 3
IF %M%==4 GOTO 4
IF %M%==5 GOTO 5
IF %M%==0 GOTO BYE
GOTO MAIN
:1
CLS
MODE con cols=100 lines=20
echo WARNING this will reboot the computer
pause >nul
gpupdate /force /sync /boot
pause
GOTO MAIN
:2
CLS
MODE con cols=100 lines=20
gpupdate /force
pause
GOTO MAIN
:3
CLS
MODE con cols=100 lines=20
gpupdate
pause
GOTO MAIN
:4
CLS
MODE con cols=100 lines=20
gpresult /h %systemdrive%\temp\gpresult.html /f && chrome %systemdrive%\temp\gpresult.html
pause
GOTO MAIN
:BYE
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment