User Tools

Site Tools


blog:change_windows_desktop_background_for_day_and_night_using_batchfile

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.1293087558.txt.gz · Last modified: 2010-12-23 07:59 by brb