Posted 11 March 2012 - 03:46 AM
no need 3rd-party software. only notepad and task scheduler (accessories>system tools>scheduled tasks)
1. prepare 20 BMP pics(must be BMP; otherwise, the script won't work).
2. from those 20 pics, 4 pics are assigned for morning wallpapers, 4 for midday, 4 for afternoon, 4 for evening, and 4 for night.
3. name (or rename to) the 4 morning pics morning1.bmp, morning2.bmp, morning3.bmp, and morning4.bmp. Name the rest of the pics based on the same nomenclature (eg. midday1.bmp, midday2.bmp,...; afternoon1.bmp, afternoon2.bmp,..., etc.)
4. put those pics in one folder. you can name and put that folder whatever and wherever you like.
5. open your notepad, write down the code below, and save the file as wallpaper.VBS (pay attention to the VBS extension, it is a visual basic script)
(lines started with apostrophe (') are comments, you can refer to them to perform modification):
'--------------code starts here
'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
'60 * 1000 in the next line means sixty seconds. If the wallpapers shift is expected to occur once every ten seconds, change to 10 * 1000
WScript.sleep(60 * 1000)
ChangeWallpaperPerMinute
Loop
'--------------code ends here
6. put that VBS file in the folder where your 20 BMP pics are located
7. open the scheduled tasks (start > accessories > system tools > scheduled tasks)
8. create a new task (right click > new > scheduled task) and name it whatever you like
9. right click the created task and open its properties window
10. Press the 'browse' button near the 'run' textbox and locate your VBS file (be sure to switch the 'files of type' from programs to all files(*.*) so that your VBS file can be detected). then press Open.
11. switch to 'schedule' tab and schedule the task 'at logon.'
12. switch to 'settings' tab and check off all check boxes except the one labelled 'wake the computer to run this task.' (you can also experiment with those check boxes yourself)
13. that's it. your time of the day wallpapers changer has been created. The last thing that you have to do is logging off-logging on your computer or restarting it.
last note: if you want to deactivate this wallpaper changer, open task manager and kill wscript.exe process