JonC said:
Is there a prog. which allows you to have random desktop wallpapers.??
Each time you start up, you get a new random wallpaper from a file
containing your choices.Thanks.
I picked this up from this group ages ago, and from who I couldn't tell you,
but it works great and have been using it for a couple of years now.
Take the visual basic script below and put it somewhere (where you might
save such things).
I saved mine as random.vbs .
Place a shortcut to it in your startup folder.
(I guess you could also save it directly to your startup folder, if you like
to do things that way.)
Viola, a new wallpaper every boot.
There are a few customizations, but as it's written your bmp images should
be in your Windows folder, and/or gif/jpg images if Active Desktop is
enabled.
The other variable addresses Win2K (True/False).
*START AFTER THIS LINE (do not copy)*
'=============================================
'=== Variable Definitions - Do Not Touch ===
'=============================================
Dim ImgNum
Dim ComicArray
Dim ComicString
Dim fso, fol, File, Files
Dim Extension
Dim ImgPath, OSisWin2K, ActiveDeskTopEnabled
'===============================================================
'=== Script Customizations - Change these values as needed ===
'===============================================================
ImgPath = "C:\WINDOWS\" ' This is the directory the images are in.
OSisWin2k = False ' True if you're running Win2K, otherwise False
ActiveDeskTopEnabled = True ' True if ActiveDesktop is enabled (allows for
gif/jpg files), otherwise False (only bmp)
'===============================================================
'=== End Script Customizations ===
'===============================================================
Set fso = CreateObject("Scripting.FileSystemObject")
Set fol = fso.getFolder(ImgPath)
Set Files = fol.Files
ComicString = ""
If Files.Count <> 0 Then
For Each File In Files
Extension = LCase(Right(File.Name, Len(File.Name)-InStrRev(File.Name,
".")))
if (Extension = "bmp") then
if Not(ComicString = "") then
ComicString = ComicString & ","
end if
ComicString = ComicString & File.Name
elseif ActiveDeskTopEnabled and ((Extension = "gif") Or (Extension =
"jpg")) then
if Not(ComicString = "") then
ComicString = ComicString & ","
end if
ComicString = ComicString & File.Name
end if
Next
End If
Set Files = Nothing
Set fol = Nothing
Set fso = Nothing
ComicArray = Split(ComicString,",")
' Choose Random Array element
Randomize
ImgNum = Int((UBound(ComicArray)+1)*Rnd)
Set Shell = CreateObject("WScript.Shell")
With Shell
' Set Wallpaper Image
.Regwrite "HKCU\Control Panel\Desktop\Wallpaper", ImgPath &
ComicArray(ImgNum)
' Update to display
.Run "control desk.cpl"
Do Until .AppActivate("Display Properties")
Loop
if OSisWIn2K then
.AppActivate("Display Properties")
.SendKeys "{up}{down}{tab 4}~"
else
.AppActivate("Display Properties")
.SendKeys "{up}{down}{tab 3}~"
end if
End With
Set Shell = nothing
'Clear up ComicArray
Set ComicArray = Nothing
*END HERE (do not copy)*
Hope this helps!
-Bill
http://wayoutwest.tk