Solved

Change Wallpaper with a batch file (Windows 7)

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

#Citrix #POC #XenDesktop #vCenter #VMware #ESX
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 the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

809 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