Computing Staff
  • 2

Wallpaper Changer Batch File Or Script Help

  • 2

I change my wallpaper a lot, and every time I do so I have to change its position to center or stretch via display properties. Surely a batch or VBScript file could perform this simple task? That way I could assign a shortcut key to it and save a lot of time.

Share

2 Answers

  1. I’ve worked this out using XP SP3 but by all means check it in regedit manually before you start:
    Paste what follows between the two lines below into NotePad and save it as:
    Center.reg
    ===============================================
    Windows Registry Editor Version 5.00

    [HKEY_USERS\S-1-5-21-602162358-1336601894-725345543-1005\Control Panel\Desktop]
    “WallpaperStyle”=”0”

    ===============================================

    Now Paste what follows between the next pair of lines into NotePad and save
    this one as:
    Stretch.reg
    ===============================================
    Windows Registry Editor Version 5.00

    [HKEY_USERS\S-1-5-21-602162358-1336601894-725345543-1005\Control Panel\Desktop]
    “WallpaperStyle”=”2”

    ===============================================

    Note that you must have either one or two (max) line feeds at the bottom below each Wallpaper Style entry.

    You should then be able to switch between Center and Stretch by double clicking the appropriate file. To avoid the prompts you can run each of these via a batch file with /s in it. If you need any assistance with this I’ll be back tommorow as its gone 1.15am now and I’m off to bed.

    There is probably a way of toggling these registry changes via a shortcut but that could take a bit more thought – at least it points you in the right direction. Let us know how you get on.

    • 0
  2. “[I don’t know a way of incorporating Alt+A into a batch file – someone else might].”

    Download NirCMD: http://www.nirsoft.net/utils/nircmd…

    Unzip nircmd into your Windows directory (or Windows\System32)

    Then do this:

    nircmd.exe sendkey 0x12 down
    nircmd.exe sendkey a press
    nircmd.exe sendkey 0x12 up

    For more nircmd sendkey help: http://nircmd.nirsoft.net/sendkey.html
    For more Virtual Key Codes: http://msdn.microsoft.com/enus/library/ms927178.aspx

    “is there perhaps a way I can tell the batch file to press “OK” in the display properties upon opening it?”

    ::SCRIPT.bat

    @echo off
    start control desk.cpl,,@desktop
    nircmd.exe wait 3000
    nircmd.exe dlg “” “” click ok
    exit

    You will need nircmd for this, download link above.

    Regards,

    Happy is ONE who says I am an OttoMAN.

    • 0