Created
November 24, 2010 17:20
-
-
Save s7ephen/714023 to your computer and use it in GitHub Desktop.
How to change the desktop wallpaper from powershell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set-itemproperty -path "HKCU:Control Panel\Desktop" -name WallPaper -value accipiter.png |
Is there a way to get these awesome scripts to work for an entire DIR, instead of single file?
Cheers
$setwallpapersrc = @"
...
Thank you very much, perfectly working with powershell, amazing :o
It doesn’t seem that this works, just tested on windows 10 (server?) in an azure lab VM I had lying around. Is this broken in newer windows versions or am I doing this wrong? I copy-pasted the command and used a random JPG I found on the internet as the test background. I received no errors when I run it, but it didn’t change anything. If I use get-itemproperty I can see WallPaper
is set to fish.jpg but the desktop background isn’t changing…
Oh never mind you just have to restart the system. Is there any way to force the wallpaper/desktop update?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@gabrielkryss You can put BirkhoffLee's post above in a ps1 file like so:
And call it like so:
Or you could keep your wallpaper at a specific location (e.g., $env:LOCALAPPDATA\wallpaper.png) and have your script simply set that path as the wallpaper.