Vista Wallpaper VB login script - refresh problem

Discussion in 'Windows Vista General Discussion' started by MirokuKage, May 1, 2007.

  1. MirokuKage

    MirokuKage Guest

    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-
    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
     
    MirokuKage, May 1, 2007
    #1
    1. Advertisements

  2. MirokuKage

    MirokuKage Guest

    MirokuKage, May 8, 2007
    #2
    1. Advertisements

  3. MirokuKage

    Jon Guest


    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, May 9, 2007
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.