Display a random wallpaper on WinXP

Two files, ImageMagick, and a scheduled task.

Copy the following into files:


'Run random.bat without displaying a window
CreateObject("Wscript.Shell").Run "random.bat", 0, True


@echo off
set img=
set len=0
for /f "delims=" %%a IN ('dir /b /s *.png') do (
set /a len+=1
if %len%==0 goto :END
set /a idx=%random% %% %len%
for /f "skip=%idx% delims=" %%a IN ('dir /b /s *.png') do (
set img=%%a
goto :BRK
IMconvert "%img%" bmp3:random.bmp
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters 

Note: As you can see above, I renamed convert to IMconvert because of a well-known naming conflict.

  1. Place those two files in, I don’t know, maybe MyDocs/MyPics/Wallpapers or where ever.
  2. Add all kinds of PNG images to the folder from step one. Sub-folders are welcome.
  3. Run random.bat or random.vbs once to produce random.bmp.
  4. Set your wallpaper to random.bmp.
  5. In the Control Panel, you’ll find Scheduled Tasks. Make a new one and set it to random.vbs. Play around with the options for the task. I have mine set for logon, system idle, and at fixed times throughout the day.

That’s it. Enjoy!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s