Question background:
I set my background to slideshow that changes every 10 minutes. It also choose the accent color automatically from my background and show the accent color on start, taskbar, and action center. These settings are slowing down my computer. Changing the background every 10 minutes is not that much of a problem, but adapting the selected color to the start menu, taskbar and action center seems to sort of restart taskbar which slows down the computer that moment. During normal use, this slowdown is shorter and doesn't affect anything, but when I'm in a game, this slowdown ruins my game. So, I need to change these setting before I enter a game. The fastest way to do this is in the following order: First I need to uncheck Automatically pick an accent color from background, so that my taskbar won't restart itself. Second, I switch the Background to single picture from slideshow. (If I firstly switch background to single picture, taskbar still restarts itself even though the same background and same accent colors). Of course, when I exited the game, I manually revert these changes again.
How can I do this with one (or two, one to make "game mode" changes and one to undo them) .bat file?
Screenshots of my settings:
What I tried:
I found Automatically pick an accent color from background setting in HKEY_CURRENT_USER\Control Panel\Desktop. There is a REG_DWORD called AutoColorization so, this batch script automatically switch the value between 0 (off) and 1 (on)
@echo off
setlocal enabledelayedexpansion
set KEY=HKEY_CURRENT_USER\Control Panel\Desktop
set VALUE=AutoColorization
REM Check current value of the registry key
for /f "tokens=3" %%i in ('reg query "%KEY%" /v "%VALUE%" ^| findstr "%VALUE%"') do (
set /a CURRENT_VALUE=%%i
)
REM Toggle the value of the registry key
if !CURRENT_VALUE! equ 1 (
set /a NEW_VALUE=0
) else (
set /a NEW_VALUE=1
)
REM Update the registry key with the new value
reg add "%KEY%" /v "%VALUE%" /t REG_DWORD /d %NEW_VALUE% /f
REM Display the new value
echo %VALUE% set to %NEW_VALUE%
However, when I change registry key to 1 in this way, my the taskbar color does not update instantly, I have to wait for it to change to the next photo in the slideshow. But when I turn it on in the settings, the color update is applied instantly. This is what I mean by the "sort of restart" I mentioned above. I do not want to kill and restart explorer.exe entirely since it closes File Explorer windows etc. and also has more burden. So, I need to find how does this setting refresh the taskbar and find the code to refresh the same way.
I also find that Background switch in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers. There is a REG_DWORD called BackgroundType. 0 is Picture, 1 is Solid Color, and 2 is Slideshow.
However, when I change the value from the registry, nothing is applied. Background remains the same. As soon as I open the background tab in the settings, the registry entry returns to the old value. I probably need to change some other entries, but I can't find what they are.
Summary:
1-) When I change the accent color setting in the registry, I need to find a way to apply it directly to start, taskbar and action center (without taskkill)
2-) I need to find out which registry edits I need to make to change the background setting between Picture and Slideshow.
3-) I need to combine these settings into a batch file that will apply and change them sequentially.


