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.1293087620.txt.gz · Last modified: 2010-12-23 08:00 by brb