Most users don't realize it, but Microsoft installs a copy of their Visual Basic Script language on every Windows computer. This simple but powerful language makes it possible to automate nearly every task a user or administrator will need to perform on a system, such as change the desktop background.
Creating a Visual Basic Script is easy: all you need is a simple text editor such as Windows Notepad. However, instead of saving the file with a name that ends in ".TXT," the file must be saved with a name ending in ".VBS."
Paste the following into a text editor:
dim shell dim user
Set shell = WScript.CreateObject("WScript.Shell") user = shell.ExpandEnvironmentStrings("%USERNAME%")
Set fso = CreateObject("Scripting.FileSystemObject")
Video of the Day
windowsDir = fso.GetSpecialFolder(0) wallpaper = "c:\wallpaper.jpg"
shell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", wallpaper
shell.Run "%windowsDir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
Change the file "c:\wallpaper.jpg" to the path and filename of the desktop background you would like to use.
How to Run
To run the script, simply save it with the file extension .VBS. Then, double-click its icon on your Desktop with your mouse as you would to start any other program.