
Random Wallpaper through Scheduled Tasks
Originally published on my old blog at cumps.be on September 1, 2004.
With my new laptop I got a screen with a 1920x1200 resolution, so I went out looking for wallpapers for the resolution, because my existing ones degraded in quality with that size.
My search led to Deaddreamer from which I have my current wallpaper as well.
But nowadays he has so many good ones that I picked five 1600x1200 wallpapers. And now I want a random wallpaper each time I log on.
Having some spare time (very rare) I created something small myself, I’m sure there are tools out there to do all that.
Originally I wanted to use PHP to get a random number and set the wallpaper, and then call the PHP script from a batch file and set it as a scheduled task. But that kept popping up a DOS prompt each time it set it, and my wallpaper disappeared after boot (some bad registry settings).
So I used KiXtart to set the wallpaper and then link it with a shortcut which would run minimized.
That worked for one paper, but when I tried the RAND function in KiXtart, it didn’t go well… But I had the PHP script and batch file still there so I let that make a random number and then call the KiX script with that number as argument.
Result:
Shortcut to wall.bat, which calls wall.php, which makes a random number and calls wallpaper.kix with the number, after which my wallpaper is set, and saved in registry.
I set the shortcut to run minimized, at logon and every hour, and now I got a nice random wallpaper implementation.
Overly complicated? Maybe. If you have PHP installed, it’s a small solution, otherwise you need a 1.3 MB DLL and a 24 KB php.exe in the same dir, which isn’t really something bad.
I have zipped everything and written the steps to install it out in a Readme.txt for everyone wanting it as well. I also included the php.exe and DLL.
Download it here: RandomWall.zip (706 KB).
And now I have sweeeet super-detailed wallpapers auto-changing without any special timer programs running, but just the Scheduled Tasks :)
Here are my wallpapers:
ddr_0075_vertical_theory_pure.jpgddr_0075_vertical_theory_decay.jpgddr_0088_v1r2a_1600x1200.jpgddr_0091_bioforge_1600x1200.jpgddr_0086_21st_century_kaos_1600x1200.jpg
Convert them to .bmp first; I’m not sure it’s required, but BMP is nicer, since the desktop doesn’t need to go into Web mode.
You May Also Like

Hacking Uxtheme.dll: Watercolor Theme
Patching uxtheme.dll on Windows XP to use custom visual styles like the Watercolor theme I've used for a year.

Custom Run Box (Resource Hacking)
Resource hacking shell32.dll on Windows XP to give the Run box a custom look, with ResHacker and Replacer.

Tweaking the Run Box (Windows Resource Hacking)
Time for a new article, but not about C# this time.



