Cześć!
Ref: PowerBGInfo issue #18.
Invoking Set-DesktopWallpaper -Index 0 -WallpaperPath C:\BGInfo\FooBarBackground.jpg on a Windows 11 24H2 (26100.3775) computer, elevated, generates the following error, if I have previously connected via RDP:
Set-DesktopWallpaper : Error HRESULT E_FAIL has been returned from a call to a COM component.
At line:1 char:1
+ Set-DesktopWallpaper -Index 0 -WallpaperPath C:\BGInfo\FooBarBackgrou ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-DesktopWallpaper], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,DesktopManager.PowerShell.CmdletSetDesktopWallpaper
Note that the following works on the same machine whether or not I've used RDP (don't know if it's of any help though):
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Wallpaper {
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
}
"@
[Wallpaper]::SystemParametersInfo(20, 0, "C:\BGInfo\FooBarBackground.jpg", 3)
I see the same error, calling Get-DesktopWallpaper, with no parameters:
Get-DesktopWallpaper : Error HRESULT E_FAIL has been returned from a call to a COM component.
At line:1 char:1
+ Get-DesktopWallpaper
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-DesktopWallpaper], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,DesktopManager.PowerShell.CmdletGetDesktopWallpaper
Steps to reproduce:
- Boot machine
- Log in via RDP
- Disconnect from RDP without logging off
- Connect locally as the same user (i.e. retaining the previous login session)
- Run
Get-DesktopWallpaper in PowerShell prompt
Cześć!
Ref: PowerBGInfo issue #18.
Invoking
Set-DesktopWallpaper -Index 0 -WallpaperPath C:\BGInfo\FooBarBackground.jpgon a Windows 11 24H2 (26100.3775) computer, elevated, generates the following error, if I have previously connected via RDP:Note that the following works on the same machine whether or not I've used RDP (don't know if it's of any help though):
I see the same error, calling
Get-DesktopWallpaper, with no parameters:Steps to reproduce:
Get-DesktopWallpaperin PowerShell prompt