Change Wallpaper in VBScript

Discussion in 'Scripting' started by Herby, Feb 10, 2004.

  1. Herby

    Herby Guest

    Hello All !

    I need to create a script to change the windows wallpaper.
    Have anyone an idea, how I can do this ?

    best regards,
    Herby, Feb 10, 2004
    1. Advertisements

  2. Hi

    This free command line utility works for all Microsoft OSes:

    Set Wallpaper (SetWallpaper.exe)

    For Win2k and WinXP, this vbscript should work:

    Set oShell = CreateObject("WScript.Shell")
    Set oFSO = CreateObject("Scripting.FileSystemObject")

    sWinDir = oFSO.GetSpecialFolder(0)
    sWallPaper = sWinDir & "\Coffee Bean.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
    Torgeir Bakken (MVP), Feb 10, 2004
    1. Advertisements

  3. Herby

    Guest Guest

    Hello Torgeir !

    Thanks a lot ! That's the tool/information I am looking

    best regards to Norway,
    user32.dll,UpdatePerUserSystemParameters", _
    Guest, Feb 10, 2004
    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.