I think this app really earns the title of simplest wallpaper changer ever. I wrote it a while back to use with some scripts … and after some discussion on the GeoShell forums I’ve decided I should go ahead and post this here, with some little scripting tips.
Basically, the program, which I’ve called wally is a simple command-line app with a single function: it takes the path to a bitmap, and sets that bitmap as the wallpaper. But there are so many possibilities!
For instance: you could give yourself a right-click item in explorer that fires off wally on bitmaps.
@="C:\Program Files\Toys\wally.exe %1"
It’s really simple, you just add a key to your bitmap object in windows. Open up Regedit.exe, and double click on HKEY_CLASSES_ROOT in the left pane. Type “.bmp” ... and it should navigate you down and select that key (folder) in the treeview. If you look in the right side (don’t click) you should see a line at the top that says: (Default) REG_SZ Paint.Picture. The last part is the “Data” ... and it’s the name of this file type. I’m using the default type for bitmaps in this example. Once you’ve found this (Default) value, you can try typing it’s name and (if you type fast enough) regedit should scroll down the left side again and show you that key! Click on it’s little plus sign to open it, and then click on “shell” to expand that. You should now see a list of the things which show up in explorer’s right-click menu for bitmaps! If you right-click in the right side, you should get a popup menu … where you will select “New” and then “Key” ... that will be created in the left side, and you can name it “Set As Wallpaper” (or whatever you like). Then, in the right side, double-click on (Default) and type the path to where you put wally.exe and add a %1 on the end. You should now see something like this:

Now, bring up your file manager and right-click on a bitmap image. How cool is that?
Another thing you can do is script it… Here’s a very simple VBScript which picks a bitmap image at random from a folder and then calls the “Set As Wallpaper” verb which we defined above:
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(WallpaperFolder)
Set files = objFolder.Items
randomize
i = cint((files.Count - 1) * Rnd)
While lcase(right(files.Item(i).name,3)) <> "bmp"
i = cint((files.Count - 1) * rnd)
Wend
files.Item(i).InvokeVerbEx("Set As Wallpaper")
If you didn’t set up the right-click command, you could replace that last line with:
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.Run “C:\Program Files\Toys\wally.exe “ & files.Item(i).Path, 0, true
Of course, there are all sorts of other things you could do … like putting that script in your “Scheduled Tasks” to run it every couple of hours. Or using a script or batch file and ImageMagick to convert your jpeg images to bitmaps on-the-fly instead of having to store them all as bitmaps. But hey … this post is just about “wally”:/scripting/wally.exe!
Similar Posts:
- None Found
Well, it’s okkaaaay I supposed..
What you really need is some uber software that will convert any file to bmp and set it was wallpaper, randomly taken from a specified folder.
heh
Shame about my runtime requirments though
Heh. I’m sure there’s probably a program over on Just Kez ... which I have linked, right up there on the left column [
] ... that can convert jpgs and randomize and all that jazz! [
]
I tried to copy and run the vb script for changing wallpapers, but could not get it to run without getting a compilation error. This is the script I used:
WallpaperFolder = “C:ShellscriptingWallChanger”
Set objShell = CreateObject(“Shell.Application”)
Set objFolder = objShell.Namespace(WallpaperFolder)
Set files = objFolder.Items
randomize
i = cint((files.Count – 1) * Rnd)
While lcase(right(files.Item(i).name,3)) <> “bmp”
i = cint((files.Count – 1) * rnd)
Wend
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.Run “C:DocumentsandSettingswayneDesktopwallpaperchanger.vbs” & files.Item(i).Path, 0, true
What am I doing wrong (I assume I am not replacing some variables that should be replaced for my system/directory that I am running the script within, etc.
Let me know if you get a chance.
Thanks for the help.
I really need a script or something so I can make a button on a webpage set a specific background.
Something like onMouseClick:javascript(‘setasbackground(abc.gif)’) ...
Can anyone help me?
Wayne … there’s something weird going on with my Code Beautifier script, so the backslashes were missing from what you copied. They should be back now (they might be doubled, hopefully not). Anyway, you’ll have to download and use Wally.exe, you can’t just use the script. (Otherwise, you could use the method I described in Better Wallpaper Changer using IrfanView).
Mario: it can’t be done. You’re not allowed to access the registry from a webpage script.
I am looking to use wally in an application on several workstations.Do you have any kind of licensing?
Do whatever you like with it. If I come across my source again, I’ll put it up public domain, no strings attached. It’s really so simple it’s just not worth it.
Great Idea, just what i needed!
but couldnt get it to work
i had a similar problem with a python script i wrote,
the wallpaper just goes blue
the thing i like the most about your program is it is
exactly not what kez (above) wanted. you know how
hard it was sto find a program that just changes your
wallpaper according to the command line arg!!!!
anyways..
thanks