Difference between revisions of "Powershell to set wallpaper"
From MyWiki
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<source lang = "powershell"> | <source lang = "powershell"> | ||
Function Set-WallPaper($Value) | Function Set-WallPaper($Value) | ||
− | |||
{ | { | ||
− | + | Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $value | |
− | + | rundll32.exe user32.dll, UpdatePerUserSystemParameters | |
− | + | ||
− | + | ||
− | + | ||
} | } | ||
</source> | </source> | ||
− | Set-WallPaper -value " | + | |
+ | curl -Outfile c:\wall.jpg http://downloads.twig.tk/wall.jpg<br> | ||
+ | Set-WallPaper -value "c:\wall.jpg" |
Latest revision as of 12:23, 29 November 2017
Function Set-WallPaper($Value) { Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $value rundll32.exe user32.dll, UpdatePerUserSystemParameters }
curl -Outfile c:\wall.jpg http://downloads.twig.tk/wall.jpg
Set-WallPaper -value "c:\wall.jpg"