PowerBGInfo icon indicating copy to clipboard operation
PowerBGInfo copied to clipboard

[question/enhancement] Can it set the logon desktop background?

Open scottcopus opened this issue 2 years ago • 4 comments

Proposed tags: question/enhancement

Sysinternals BGInfo can supposedly set various 'logon' desktop backgrounds too. However, I've not had any luck with it though. Can PowerBGInfo do this?

image

cheers, Scott

scottcopus avatar May 09 '23 13:05 scottcopus

At the moment it can't do that, but I saw some PowerShell code to set Logon Desktop Background. Would need to see if it works, if so there's no reason why this couldn't work.

PrzemyslawKlys avatar May 10 '23 08:05 PrzemyslawKlys

Would love to see this get added! I'm thinking this may require elevation and a good way to elegantly ask for elevation. But in my case, I'd probably be running it with admin/system permissions anyway, so it's a moot point--at least for me.

BTW, I've not used it yet, but I'm assuming that the normal use case of modifying my own user backgrounds doesn't require elevation anyway?

scottcopus avatar May 10 '23 19:05 scottcopus

No it doesn't. But the logon screen will.

PrzemyslawKlys avatar May 10 '23 20:05 PrzemyslawKlys

Hi,

PowerBGInfo creates a file based on the name of your wallpaper. Let's say that you use these options:

  • FilePath is C:\Wallpaper.png
  • ConfigurationDirectory is C:\PowerBGInfo Then the generated wallpaper will be C:\PowerBGInfo\Wallpaper_PowerBgInfo.png

So you can use that file to make it your logon wallpaper. You'll have to make a Computer GPO or a task that runs before you open your session. Here's a PS script to do that (must be run with Admin privs as it modifies HKLM):

$LockScreenImage = "C:\PowerBGInfo\Wallpaper_PowerBgInfo.png"
$RegKeyPath      = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP"
New-Item -Path $RegKeyPath -Force | Out-Null
New-ItemProperty -Path $RegKeyPath -Name LockScreenImageStatus -Value 1                -PropertyType DWORD  -Force | Out-Null
New-ItemProperty -Path $RegKeyPath -Name LockScreenImagePath   -Value $LockScreenImage -PropertyType STRING -Force | Out-Null
New-ItemProperty -Path $RegKeyPath -Name LockScreenImageUrl    -Value $LockScreenImage -PropertyType STRING -Force | Out-Null
RUNDLL32.EXE USER32.DLL, UpdatePerUserSystemParameters 1, True

Works on Windows 10, 11, 2016, 2019, 2022 and 2025. But there are some limitations that you must be aware of: as the user is not logged in at the time that the script runs you won't be able to print infos like "BuiltinValue FullUserName"

Cool34000 avatar Feb 16 '25 07:02 Cool34000