Author Posts

November 30, 2017 at 3:13 pm

Hi Guys

This is quite a basic ask but I'm just learning PS 🙂

I'm looking for a script to change the wallpaper for all users and center the image (not stretch etc)

At the moment I have the below but it doesn't center it? will mthe below do this for all profiles too?

Function Set-WallPaper($Value)
{
Set-ItemProperty -path 'HKCU:\Control Panel\Desktop\' -name wallpaper -value $value
rundll32.exe user32.dll, UpdatePerUserSystemParameters
}
Set-WallPaper -value "C:\software\logo.bmp"

November 30, 2017 at 4:30 pm

.bat not powershell:

rem change wallpaper
takeown /f c:\windows\WEB\wallpaper\Windows\img0.jpg
icacls c:\windows\WEB\wallpaper\Windows\img0.jpg /Grant System:(F)
icacls c:\windows\WEB\wallpaper\Windows\img0.jpg /Grant Administrators:(F)
copy /y %~dp0\Wallpaper.jpg c:\windows\WEB\wallpaper\Windows\img0.jpg