To change windows desktop wallpaper what we normally do is right click on the desktop and go properties and so… But we can do the same by editing registry key using reg command from command line. The command is given below.
reg add “HKEY_CURRENT_USER\Control Panel\Desktop” /v Wallpaper /t REG_SZ /d wallpaper_path /f
For example to set the image E:\photos\image1.jpg as the wall paper we need to run the command as below.
reg add “HKEY_CURRENT_USER\Control Panel\Desktop” /v Wallpaper /t REG_SZ /d E:\photos\image1.bmp /f
After editing the registry key we need to run the below command to make the change take effect immediately.
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
Note that this method works only for bmp images. If you have .jog or .jpeg images you can’t set them as wallpaper from command line. You can use the Desktop settings UI to set a .jpg or .jpeg file as wallpaper.
{ 10 comments… read them below or add one }
This won't work for two reasons:
1) file needs to be a bmp
2) writing the registry doesn't cause the change to happen, you need to do something like:
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
as well
Thanks for the comment..will modify the post with these steps..
Hello, it appears this command does not work for me, I honestly don't know why…the reason I want to do this is because my windows7 does not have the option to select an image as background when I right click and look at the pop up menu….Any help or suggestions will be appreciate. Thanks
Try doing it from Control panel -> Appearance and personalization -> Personalization.
Were you trying to do this in RDP connection? Looks like desktop background can't be changed in remote desktop connections.
My windows7 does not even have this personalization option, siriosly. I am also not using any RDP connection…Any other suggestions? …Is my windows7 screwed up, not installed correctly/fully? Thanks!
you are using wiondows 7 starter! you cannot change backgound picture in windows 7 starter edition
Hello, I wonder why this update thing doesn’t work for me.
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
The wallpaper is changed in the registry (I checked through regedit.exe) and also in Personalization the new image seems to show up.
But I can’t get it to update immediately.
Thanks in advance.
Looks like the rundll update command is not working in Windows 7. It works in XP. I could not find any other command to make the wall paper changes take effect immediately. However a logoff and login would change the wallpaper.
Forgot to mention, I’m using Window 7 Pro and just locally no remote connections. I want to make this work in a batch script where some conditions are changed
There is two more keys:
1) WallpaperStyle
2) TileWallpaper.
WallpaperStyle = 10 and TileWallpaper = 0 make walpaper filled
WallpaperStyle = 6 and TileWallpaper = 0 make walpaper fited
WallpaperStyle = 2 and TileWallpaper = 0 make walpaper stretched
WallpaperStyle = 0 and TileWallpaper = 0 make walpaper centered
WallpaperStyle = 0 and TileWallpaper = 1 make walpaper tiled