Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
scottcopus opened this issue May 9, 2023 · 4 comments
Open
Labels
enhancement New feature or request

Comments

@scottcopus
Copy link

scottcopus commented May 9, 2023

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

@PrzemyslawKlys
Copy link
Member

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 PrzemyslawKlys added the enhancement New feature or request label May 10, 2023
@scottcopus
Copy link
Author

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?

@PrzemyslawKlys
Copy link
Member

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

@Cool34000
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants