Solved

Change Wallpaper with a batch file (Windows 7)

Posted on 2010-11-09
5
8,332 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

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 teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

726 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