Solved

Change Wallpaper with a batch file (Windows 7)

Posted on 2010-11-09
5
7,671 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now