I am new to this forum and to Powershell at all. So, plz forgive if I ask simple or even stupid questions!
My actuell problem is this:
I have 2 folder with wallpapers (name it folder A and folder B) and I need a Switch to change them. Actually I do it manually (changing background-folder), but I hope, this exercise should be very easy, or do I am wrong?
I searched the web for solutions, but all I found are only scipts to change background-wallpaper to a specific picture or nothing.
Even how to get the actual path to my background-wallpaper-folder is tricky because there is no hint, at which path the “TranscodedWallpaper” is pointing.
So, can someone help me (or is such an inquiry not welcome)?
Strange questions… I am an ex-developer (better ex-programmer), because I now do “only” support! I only do programming out of work.
And the information, which folder is used for a wallpaper-slideshow must be stored somewhere - when I start windows it is always the same!
In my oppinion you should get the path of the wallpaper-folder actually displayed (so folder A oder B) then set it to the opposite folder. Is this so strange? Or difficult (if you know powershell)?
OK, I think I have expressed myself in a somewhat misleading way.
There is no magical command in PowerShell to determine where the setting is which folder the “wallpaper folder” is. But if you know where the setting is it’s very likely very easy to read or to manipulate it.
What I want to say is: we do not deliver ready to use code or solutions on request. But we’d be happy to help you with code you wrote by yourself and got stuck with.
Please use your favorite internet search engine to figure out where Windows saves the setting what folder is used for wallpapers. Probably it’s somewhere in the registry.
If you want to read the registry you can use Get-ItemProperty
and with Set-ItemProperty
you can manipulate already existing settings.
This is a bit of a hack but it works:
Using Settings | Personalize - set folder A
Rename slideshow.ini to slideshow.a
Using Settings | Personalize - set folder B
This will create a new slideshow.ini file.
Now you have two .ini files with the folders encoded.
I can’t find a ‘proper’ way to trigger the change once the folder updates, but restarting the Explorer process does the trick. So it’s a fairly simple script to switch between folders: