User Tools

Site Tools


blog:change_windows_desktop_background_for_day_and_night_using_batchfile

This is an old revision of the document!


Change windows desktop background for day and night, using batchfile

::==chwallpaper.bat
 
Echo %Time%
 
for /f "tokens=1-3 delims=:." %%a in (
"%time%") do set hours=%%a
 
set wallpaper=e:\etc\wallpaper_tag.bmp
if %hours% LSS 8 goto setnight
if %hours% GTR 20 goto setnight
goto setit
 
:setnight
set wallpaper=e:\etc\wallpaper_nacht.bmp
 
 
:setit
 
Echo Setting wallpaper to %wallpaper%
 
REG ADD "HKCU\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d %wallpaper% /f 
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
 
:finish

~~LINKBACK~~

Discussion

Enter your comment. Wiki syntax is allowed:
  ____    ____   ___    ____   ____
 / __ \  /  _/  / _ |  / __/  / __/
/ /_/ / _/ /   / __ | / _/   _\ \  
\___\_\/___/  /_/ |_|/___/  /___/
 
blog/change_windows_desktop_background_for_day_and_night_using_batchfile.1293087551.txt.gz · Last modified: 2010-12-23 07:59 by brb