I have Windows 10 laptop and I really like all the Lock Screen wallpapers that Windows change automatically occasionally. Is it possible to change the my desktop background with the same wallpaper at the same time?

  • superuser.com/questions/1014993/… Did you do any research prior to asking this here? I did a quick web search and there are TONS of guides to do this. Did you try any of these yet? Did they work or not? – music2myear Apr 5 at 17:48
  • @music2myear I definitely did. I am looking for automated way to change the desktop wallpaper, when the window spotlight changes the lock screen wallpaper. – Cricrazy Apr 5 at 17:52

From here: https://www.thewindowsclub.com/use-windows-spotlight-desktop-wallpaper-slideshow

Save the following as a Powershell script:

$files = gci $Env:LocalAppData\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets | where Length -gt 1kb

if ($files) {
    $shell = New-Object -ComObject Shell.Application
    #destination for pictures (if doesn't exist, will be created)
    $folder = "$Env:USERPROFILE\OneDrive\Pictures\Wallpaper\Spotlight"
    if (!(Test-Path $folder)) { mkdir $folder }
    $files | % {
        $_ | Copy-Item -Destination $folder\$_.jpg
        Get-Item $folder\$_.jpg
    } | % {
        $namespace = $shell.namespace($folder)
        $item = $namespace.ParseName($_.Name)
        $size = $namespace.GetDetailsOf($item, 31)
        if ($size -match '(\d+) x (\d+)') {
            $width = [int]($Matches[1])
            $height = [int]($Matches[2])
        if (!$size -or $width -lt 1920 -or $height -lt 500) {
            Remove-Item $_

If you wish, modify the line $folder = "$Env:USERPROFILE\OneDrive\Pictures\Wallpaper\Spotlight" to place the files where you want them.

Save the following as an .xml file:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <Description>Copies files larger than 1kb from "LocalAppData\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets" to "USERPROFILE\OneDrive\Pictures\Wallpaper\Spotlight\", omiting any files with a width less than 1920 or height less than 500 pixels.</Description>
    <URI>\Shawn Keene\Copy Spotlight Pictures</URI>
    <Principal id="Author">
  <Actions Context="Author">
      <Arguments>-ExecutionPolicy Bypass -file "C:\Path\To\PowerShel\Script\savespotlight.ps1"</Arguments>

If you modified the PowerShell script, you'll need to make matching change in the XML file. Also, you'll need to change the Arguments line to point to your Powershell script file location: <Arguments>-ExecutionPolicy Bypass -file "C:\Path\To\PowerShel\Script\savespotlight.ps1"</Arguments>

Open the Task Scheduler and import this XML as a scheduled task. Make any adjustments to the settings that you wish. Set the trigger to run this script daily.

Now open Settings > Personalize and set your Background to a Slideshow and select the folder you've specified as the source folder for the slideshow images.

  • Thank you so much. It works wonderfully. Now I can have all those really cool wallpapers as a desktop background. – Cricrazy Apr 9 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.