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.
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.