Changing wallpaper with batch file

Hardware discussions about AMD Eyefinity
Post Reply
oskarom
Posts: 10
Joined: 24 Nov 2009, 20:05

Changing wallpaper with batch file

Post by oskarom »

Hi,

I'm not quite sure that this is the right place so please feel free to move this tread.

Well my idea here is to utilize the Catalyst profile changer's ability to run a command or program when you change profile.

Any who my idea was to run the following .bat file when changing to Extended mode:

@echo off
REG ADD "HKCUControl PanelDesktop" /v Wallpaper /t REG_SZ /d "D:ImagesOthersWallpaperscurrentEXTE.jpg" /f

And this one when changing to Eyefinity mode:

@echo off
REG ADD "HKCUControl PanelDesktop" /v Wallpaper /t REG_SZ /d "D:ImagesOthersWallpaperscurrentEYEF.jpg" /f

The reason for all this hassle is that when I'm in extended mode I use my center monitor as the primary monitor and Windows 7 is so cleaver that it thinks that this is where the wallpaper should start so the left most part of the picture is actually in the center and the right most part is on the left monitor. Hope fully you understand me, I can provide screenshots if you guys like to.

My batch solution works, well it almost works... it does change the wallpaper selected, but I still need to find some way to refresh the desktop... simple F5 won't do the trick here.

Even if I go to "Personalize" it shows that the wallpaper has changed...

Any ideas?

Regards
Oskar

EDIT: Spelling error
evilmatt
Posts: 47
Joined: 23 Dec 2010, 11:07

Re: Changing wallpaper with batch file

Post by evilmatt »

I've got something along these lines working - I've got my catalyst profiles calling VB script files to change the Theme. The Control Panel's Personalize menu pops up briefly, but with all the screens flashing on and off when changing from eyefinity to extended and back it's not too much of an issue. I simply created 2 themes, one that uses a set of 1920x1080 background images, and one with 5760x1080 images.

Wscript.Sleep 5000

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "rundll32.exe %SystemRoot%system32shell32.dll,Control_RunDLL %SystemRoot%system32desk.cpl desk,@Themes /Action:OpenTheme /file:""C:UsersMattAppDataLocalMicrosoftWindowsThemesEyefinity.theme"""

Wscript.Sleep 1600
WshShell.AppActivate("Desktop Properties")
WshShell.Sendkeys "%FC"
WshShell.Sendkeys "{F4}"
techmaniac
Posts: 1
Joined: 26 Feb 2011, 04:11

Re: Changing wallpaper with batch file

Post by techmaniac »

Do you know if the script works for Vista the same? I'm running Vista U x64
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests