PC Review Forums Newsgroups Windows Vista Windows Vista General Discussion Vista Wallpaper VB login script - refresh problem

Reply

Vista Wallpaper VB login script - refresh problem

 
Thread Tools Rate Thread
Old 01-05-2007, 04:00 AM   #1
MirokuKage@gmail.com
Guest
 
Posts: n/a
Default Vista Wallpaper VB login script - refresh problem


Hello,
I put together a VB login script for XP and I'm trying to get it
working in Vista.
I'm currently having some trouble getting Vista to realize that I've
changed the desktop wallpaper.

I am able to apply a new desktop with the script below but the
desktop
image will not change until I either restart the computer or open the
"Control Panel->Personalization-
>Desktop Background" window.


Below is a simplified version of the wallpaper change script that
works in XP.
wallpaper.vbs
'_______________________________________________________
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
sWinDir = oFSO.GetSpecialFolder(0)
sWallPaper = "z:\vista profile test\wall\test1.bmp"
' update in registry
oShell.RegWrite "HKCU\Control Panel\Desktop\Wallpaper", sWallPaper
' let the system know about the change
oShell.Run _
"%windir%\System32\RUNDLL32.EXE
user32.dll,UpdatePerUserSystemParameters", _
1, True
'_______________________________________________________
So... anyone have an idea on how to get this working in Vista?

Thanks in advance,

--Miroku

  Reply With Quote
Old 08-05-2007, 10:08 PM   #2
MirokuKage@gmail.com
Guest
 
Posts: n/a
Default Re: Vista Wallpaper VB login script - refresh problem

Note: I found a post very similar to my own...
http://groups.google.com/group/micr...543d44935e08671

Unfortunately, I still can't seem to get it working using the info in
the above link. I'll continue searching for an answer on my own but
any help would be greatly appreciated.

--Miroku


  Reply With Quote
Old 09-05-2007, 01:44 PM   #3
Jon
Guest
 
Posts: n/a
Default Re: Vista Wallpaper VB login script - refresh problem

<MirokuKage@gmail.com> wrote in message
news:1178662109.591846.206850@u30g2000hsc.googlegroups.com...
> Note: I found a post very similar to my own...
> http://groups.google.com/group/micr...543d44935e08671
>
> Unfortunately, I still can't seem to get it working using the info in
> the above link. I'll continue searching for an answer on my own but
> any help would be greatly appreciated.
>
> --Miroku
>
>



You might be better looking at the SystemParametersInfo function in
user32.dll.

There's an example on this page (with the relevant constant values), of how
to change your wallpaper using VB, which works fine in Vista also

http://support.microsoft.com/kb/97142

It may be possible to come up with something similar using a rundll32.exe
command line and VBScript alone (?).

--
Jon

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off