PS to change wallpaper for all users and center the image

Welcome Forums General PowerShell Q&A PS to change wallpaper for all users and center the image

This topic contains 1 reply, has 2 voices, and was last updated by

js
 
Participant
1 year ago.

  • Author
    Posts
  • #85264

    Participant
    Points: 0
    Rank: Member

    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"

  • #85270
    js

    Participant
    Points: 326
    Helping Hand
    Rank: Contributor

    .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
    

The topic ‘PS to change wallpaper for all users and center the image’ is closed to new replies.