Solved

Change Wallpaper with a batch file (Windows 7)

Posted on 2010-11-09
5
8,586 Views
Last Modified: 2012-05-10
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?
0
Comment
Question by:IT_Crowd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 34094721

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

0
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 34094727

REG ADD "HKCU\Control Panel\Desktop" /v Wallpaper /t  REG_SZ /d "C:\\wallpaper.bmp" /f

RUNDLL32.exe user32.dll,UpdatePerUserSystemParameters

Open in new window

0
 
LVL 13

Author Comment

by:IT_Crowd
ID: 34094730
Yeah I tried that, except the wallpaper doesn't actually change.  It just stays on the slideshow that I have setup
0
 
LVL 35

Expert Comment

by:YZlat
ID: 34094829
it worked for me for images but not for html. Are you changing it to bmp?
0
 
LVL 13

Author Comment

by:IT_Crowd
ID: 34096436
:)  Embarrassing...I had a bad BMP file.   :P
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
This Micro Tutorial will go in depth within Systems and Security in Windows 7 and will go into detail regarding Action Center, Windows Firewall, System, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question