onthecuttingedge2005: I thank you for the script. Although, if your custom vbscript uses the Windows MAPI functionality, don't bother. My home network is setup with a mail server, as well as some security features, which will give you incorrect information. This is to prevent spam (lol), and other problems.
Now, I'm sorry if I got everyone's hopes up about the script. So I thought I should at least contribute a little something. Here is some code that you can use to change your desktop background.
Private Sub ChangeDesktop(ByVal imageDir As String)
Dim objFileSys As New FileSystemObject
If objFileSys.FileExists(imageDir) Then
If LCase(Mid(imageDir, Len(imageDir) - 2)) <> "bmp" Then
Call SavePicture(LoadPicture(imageDir), App.Path & "\background.bmp")
SystemParametersInfo 20, 0, App.Path & "\background.bmp", &H1 Or &H2
Else
SystemParametersInfo 20, 0, imageDir, &H1 Or &H2
End If
End If
Set objFileSys = Nothing
End Sub
The variable 'imageDir' is the absolute path to the picture you want to use for the background. You also need to declare SystemParametersInfo. Here is the code for that;
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long