Skip to content

Instantly share code, notes, and snippets.

@tinytengu
Created July 11, 2021 22:38
Show Gist options
  • Save tinytengu/919e3dc24234d7028b1a2009941d1caa to your computer and use it in GitHub Desktop.
Save tinytengu/919e3dc24234d7028b1a2009941d1caa to your computer and use it in GitHub Desktop.
Apply Windows 10 & 11 theme Batch script (with settings window suppression)
:killproc
set _kpwait=%~2
if "%_kpwait%"=="" set _kpwait=0
:killproc_loop
tasklist /fi "imagename eq %~1" |find ":" > nul
if %errorlevel% neq 1 (
if %_kpwait% equ 1 goto killproc_loop
exit /B 0
)
taskkill /f /im %~1 > nul
exit /B 0
:apply_theme
set _themepath=%~1
if "%~2" equ "rel" set _themepath=C:\Windows\Resources\Themes\%~1
%_themepath%
CALL :killproc systemsettings.exe 1
exit /B 0
rem Usage: CALL :apply_theme C:\Windows\Resources\Themes\themeC.theme
rem Applies theme C:\Windows\Resources\Themes\themeC.theme
rem Usage with relative to C:\Windows\Resources\Themes path: CALL :apply_theme dark.theme rel
rem Applies theme C:\Windows\Resources\Themes\dark.theme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment