Avatar of IT_Crowd
IT_Crowd
Flag for Heard Island and McDonald Islands asked on

Change Wallpaper with a batch file (Windows 7)

I would like to change the wallpaper on a machine by running a batch file. Here is what I have so far:

I have a script that is copying over wallpaper.bmp to c:\wallpaper.bmp
I have the following reg key changing:
[HKEY_CURRENT_USER\Control Panel\Desktop]
"Wallpaper"="C:\\wallpaper.bmp"

Open in new window


But the wallpaper doesnt seem to be changing. I have verified the file is there, and the regkey has changed. I have also tried to log off and log back on, but the registry reverts back to the way it was.  

I found a post that suggested running the following command to refresh the desktop (but that hasnt worked either)
 
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters

Open in new window


Any thoughts?
Windows 7Microsoft DOSOperating Systems

Avatar of undefined
Last Comment
IT_Crowd

8/22/2022 - Mon
YZlat


REG ADD "HKCU\Control Panel\Desktop" /v Wallpaper /t  REG_EXPAND_SZ /d "your path here" /f

RUNDLL32.exe user32.dll,UpdatePerUserSystemParameters

Open in new window

ASKER CERTIFIED SOLUTION
YZlat

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
IT_Crowd

ASKER
Yeah I tried that, except the wallpaper doesn't actually change.  It just stays on the slideshow that I have setup
YZlat

it worked for me for images but not for html. Are you changing it to bmp?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
IT_Crowd

ASKER
:)  Embarrassing...I had a bad BMP file.   :P