Forum posts for scrnsave.scr

Windows batch script to switch desktop background

Is there a way to check what a user currently has as their background and then changing it depending on what it is? For example: I want a white background during day time and a black background for night time. Running the script would check the current background, if it is white it will switch to the black background, and if it is black it will switch to the white.

I'm a little unfamiliar with Windows batch script and I'm seeking some tips and advice on how I can accomplish the task above. Here is what I've been able to find so far:

@echo off
call :quiet>nul 2>&1
goto :EOF

:quiet


:: Configure Wallpaper
REG ADD 'HKCUControl PanelDesktop' /V Wallpaper /T REG_SZ /F /D '%SystemRoot%energybliss.bmp'
REG ADD 'HKCUControl PanelDesktop' /V WallpaperStyle /T REG_SZ /F /D 0
REG ADD 'HKCUControl PanelDesktop' /V TileWallpaper /T REG_SZ /F /D 2


:: Configure the screen saver.
:: REG ADD 'HKCUControl PanelDesktop' /V SCRNSAVE.EXE /T REG_SZ /F /D '%SystemRoot%System32scrnsave.scr'
:: REG ADD 'HKCUControl PanelDesktop' /V ScreenSaveActive /T REG_SZ /F /D 1


:: Set the time out to 900 seconds (15 minutes).
:: REG ADD 'HKCUControl PanelDesktop' /V ScreenSaveTimeOut /T REG_SZ /F /D 900


:: Set the On resume, password protect box
:: REG ADD 'HKCUControl PanelDesktop' /V ScreenSaverIsSecure /T REG_SZ /F /D 1


:: Remove the user's ability to see the Screen Saver, background, and appearance tabs of Display Properties.
::REG ADD 'HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem' /V NoDispScrSavPage /T REG_DWORD /F /D 1
::REG ADD 'HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem' /V NoDispBackgroundPage /T REG_DWORD /F /D 1
::REG ADD 'HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem' /V NoDispAppearancePage /T REG_DWORD /F /D 1

:: Make the changes effective immediately
%SystemRoot%System32RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters

View complete forum thread with replies

Other posts related to scrnsave.scr

See Related Forum Messages: Follow the Links Below to View Complete Thread

Start a screensaver when explorer is not the shell
How do I run a screensaver on startup with the startscreen still displayed?
Windows batch script to switch desktop background

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.