How to change Windows 7 Wallpaper using the registry?

1

All I'm trying to do is get Windows to switch to a different Wallpaper folder at night (a folder containing night images). To achieve this I'm planning to use Task Scheduler to run .bat files which simply switch the names of the two folders around. That's pretty straight-forward.

The only problem is that Windows won't let me rename the folder containing the current Wallpaper image. This means I have to temporarily change the current wallpaper image to something else while I'm renaming the folders.

And to do this I need some kind of file to modify the registry key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General\Wallpaper

I did find a script someone had written which I think does this, but it's too technical for me to understand. I don't know anything about the C language, what classes and namespaces are, or how to create a file that runs this code in Windows. Also, it seems like a lot of code just to change the value of a single registry key. And would I have to install software?

Perhaps someone could give me some help?

Also, could anyone confirm that the Windows wallpaper folder is not kept in the registry? If it was, I could simply change this, and wouldn't have to rename folders. But I've done a lot of searching and can't find any trace of it in the registry.

L J

Posted 2019-03-05T17:43:17.070

Reputation: 29

Answers

2

goto Computer\HKEY_CURRENT_USER\Control Panel\Desktop add new string value named "Wallpaper" and set it's value to the full path of the image.

user1004629

Posted 2019-03-05T17:43:17.070

Reputation:

Thank you but I don't believe this helps me to change the wallpaper using Task Scheduler, which is what I'm trying to do. – L J – 2019-03-06T13:47:07.763

0

@zebanovich's answer is correct in that HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper is generally the key used to update the Desktop wallpaper.

Windows doesn't have a specific folder for wallpapers. You can set any file path you want in that registry key. Try this batch command:

reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d "C:\Folder\File.jpg" /f

Replace C:\Folder\File.jpg with the full path to the file you want to set the wallpaper to. You can run this directly from the command line to give it a try. If it does what you want, then create one batch file for day and one for night, then add two tasks in the task scheduler to match.

If this answer doesn't work for you, please update your question with more information.

Worthwelle

Posted 2019-03-05T17:43:17.070

Reputation: 3 556