Script to cycle wallpapers

Soldato
Joined
22 Oct 2005
Posts
2,884
Location
Moving...
Hi all.

I would like to create a script that will run on startup and cycle through a particular folder changing the wallpaper every hour or so. How would I go about that? (using XP btw).

I've looked on the web with no luck. I've seen many wallpaper utilities for download but I'd prefer to do it myself if possible.

Thanks.
 
Ok windows is officially stupid... I went through the registry editing every value that had my old wallpaper in it, to a new wallpaper and it did not update. When I went to properties there it is sitting there as the wall paper (in the settings but not on my desktop) Stupid Windows.

Need to figure out the mechanism for making the desktop pick up the change in value.

Edit:

The following Powershell code will do most of it., you will need to put in a wait command (and remove the press key bit) then get powershell to run unsigned code (look on Powershell website for this) and then schedule it (either by creating a service or by putting the script in your startup folder.

Code:
# set desktop wallpaper
# call with no arguments to set as None.
function set-wallpaper( [string]$newpaper = "" ){
     set-itemproperty -path "HKCU:Control Panel\Desktop" -name WallPaper -value $newpaper
     $(c:\windows\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters)
}

foreach ($file in dir c:\windows\*.bmp){
     set-wallpaper $file.Name
     read-host Hit any key for next paper
}
 
Last edited:
Back
Top Bottom