There are many third-party applications that you can use to allow Windows XP to automatically change desktop wallpapers, thereby making it similar to Windows 7. However, in fact, you don't need those applications to enable wallpaper slideshow on Windows XP. By using vbscript, you can create a small visual basic program that changes desktop wallpapers automatically every certain seconds or minutes. You can even use your small program to let Windows alternate between different sets of wallpapers based on the time of the day. So in the morning you can have morning wallpaper slideshow, in the afternoon you have afternoon wallpaper slideshow, and so forth. This time-based wallpaper rotation is a feature that you can never find in any third-party applications (except Stardock Natural Desktop, which is not free). To create this small program and to use it, perform the following steps.
- Prepare 20 BMP images (must be BMP) consisting of 4 morning images, 4 midday images, 4 afternoon images, 4 evening images, and 4 night images. Use Google to collect those images. After you have successfully collected all necessary images, put them in the same folder.
- Name (rename) the 4 morning images "morning1.bmp, morning2.bmp, morning3.bmp, and morning4.bmp." Use the same nomenclature for naming midday, afternoon, evening, and night images.
- Open your Notepad. We will be making the needed vbscript program by using this versatile application.
- Copy the following code and paste it in your Notepad
- Save the file as a .vbs file (File>Save As...>change the "Save as type" option to "All files (*.*)"> use "Wallpaper.vbs" (without quotation marks) as the file name>click Save button).
- Put the .vbs file in the folder where you put the already renamed 20 images.
- Use Windows XP's Scheduled Task to schedule the activation of this program during system logon.
- This vbs program is activated by vbscript.exe. If you want to deactivate it, simply open task manager and kill vbscript.exe.
'creating procedure that changes wallpaper every minute
Sub ChangeWallpaperPerMinute ()
Set obshell = WScript.CreateObject("Wscript.Shell")
CurrentHour = Hour(Now)
'determining the number of images for every time of the day-based theme (set the 'maximum' value according to the number of images for every theme)
maximum=4
minimum=1
'randomizing the images to be changed
Randomize
num = Int((maximum-minimum+1)*Rnd+minimum)
If CurrentHour >= 5 And CurrentHour <= 8 Then
wallpaper = "morning" & num & ".bmp"
ElseIf CurrentHour >= 9 And CurrentHour <= 13 Then
wallpaper = "midday" & num & ".bmp"
ElseIf CurrentHour >= 14 And CurrentHour <= 16 Then
wallpaper = "afternoon" & num & ".bmp"
ElseIf CurrentHour >= 17 And CurrentHour <= 20 Then
wallpaper = "evening" & num & ".bmp"
ElseIf CurrentHour >= 21 And CurrentHour <= 23 Then
wallpaper = "night" & num & ".bmp"
ElseIf CurrentHour >= 0 And CurrentHour <= 4 Then
wallpaper = "night" & num & ".bmp"
Else
WScript.Quit(0)
End If
obshell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper",wallpaper
obshell.Run "%windir%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters",1,False
Set obshell = Nothing
End Sub
'end of procedure creation'
'calling procedure to initiate script's action
ChangeWallpaperPerMinute
'repeating the calling of procedure
do
WScript.sleep(60 * 1000)
'60 * 1000 means sixty seconds. If the shifting of wallpapers is expected to occur once every ten seconds, change to 10 * 1000
'calling procedure
ChangeWallpaperPerMinute
Loop
Remember that this procedure doesn't work on Windows 7 and Windows 8. If you want to see how to apply time-of-the-day-based wallpaper changing in Windows 7 and Windows 8, go to Changing Windows 7 and Windows 8 Desktop Wallpaper Slideshow Based on the Time of the Day.
Post a Comment