DuguaySarah94
Member
- Local time
- 11:28 AM
- Posts
- 1
- OS
- Windows 11
Hi, I am by no means tech-savvy; however, my employers, a small business with fewer than 10 employees, asked me to evaluate and test the built-in Copilot feature in Windows to see if it could streamline processes in our office. I was selected for this bc as their research consultant and data analyst, and I'm essentially the only employee using a laptop throughout the day!
As a way to familiarize myself with software that I have never been trained on, I decided to address a problem that has plagued my HP laptop for over a year. I could never get the default blue lock screen to refresh, as in the spotlight feature, to work, including its daily refresh of new backgrounds.
I created an account here to share the script that Copilot generated, as all the fixes I attempted over the years came from this site. Any Google searches I conducted usually led me back here, so I thought it would be helpful to share this solution with others who may be experiencing the same issue.
Below is the script. It indicated that it should be run in PowerShell as an Administrator.
--Sarah
# ============================================================
# Reset-WindowsSpotlight.ps1
# This script resets Windows Spotlight (the lock screen refresh feature)
# by clearing its cache, re-registering its package, and re-enabling
# the rotating lock screen background in Windows 11.
#
# IMPORTANT:
# - Run this script as Administrator.
# - Ensure no Group Policy or enterprise management is imposing
# a custom lock screen.
#
# Tested on Windows 11 24H2 (May 2025 release).
# ============================================================
# Check for Administrator privileges.
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Error "This script must be run as Administrator. Exiting."
exit 1
}
Write-Output "Starting Windows Spotlight reset process..."
# Step 1: Define paths for Spotlight cached assets and settings.
$spotlightAssetsPath = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"
$spotlightSettingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\Settings"
# Step 2: Delete cached images and settings.
if (Test-Path $spotlightAssetsPath) {
Remove-Item "$spotlightAssetsPath\*" -Force -Recurse -ErrorAction SilentlyContinue
Write-Output "Cleared Spotlight Assets: $spotlightAssetsPath"
} else {
Write-Output "Spotlight Assets folder not found at: $spotlightAssetsPath"
}
if (Test-Path $spotlightSettingsPath) {
Remove-Item "$spotlightSettingsPath\*" -Force -Recurse -ErrorAction SilentlyContinue
Write-Output "Cleared Spotlight Settings: $spotlightSettingsPath"
} else {
Write-Output "Spotlight Settings folder not found at: $spotlightSettingsPath"
}
# Step 3: Re-register the Windows Spotlight package.
Write-Output "Re-registering Windows Spotlight package..."
try {
Get-AppxPackage -allusers Microsoft.Windows.ContentDeliveryManager | ForEach-Object {
Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml" -ErrorAction Stop
}
Write-Output "Successfully re-registered Windows Spotlight."
} catch {
Write-Error "Error re-registering Windows Spotlight: $($_.Exception.Message)"
}
# Step 4: Ensure that Windows Spotlight (rotating lock screen) is enabled.
$registryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
if (-not (Test-Path $registryPath)) {
New-Item -Path $registryPath -Force | Out-Null
}
# Enable the rotating lock screen background.
Set-ItemProperty -Path $registryPath -Name "RotatingLockScreenEnabled" -Value 1 -Type DWord
Write-Output "Enabled rotating lock screen background in registry."
# Step 5: Refresh group policies and system parameters.
Write-Output "Refreshing group policies and system parameters..."
try {
gpupdate /force | Out-Null
rundll32.exe user32.dll,UpdatePerUserSystemParameters ,1 ,True
Write-Output "Policies and system parameters updated."
} catch {
Write-Warning "Unable to fully refresh system parameters. A restart may be required."
}
Write-Output "Windows Spotlight reset process complete."
Write-Output "Please restart your computer to ensure all changes take effect."
As a way to familiarize myself with software that I have never been trained on, I decided to address a problem that has plagued my HP laptop for over a year. I could never get the default blue lock screen to refresh, as in the spotlight feature, to work, including its daily refresh of new backgrounds.
I created an account here to share the script that Copilot generated, as all the fixes I attempted over the years came from this site. Any Google searches I conducted usually led me back here, so I thought it would be helpful to share this solution with others who may be experiencing the same issue.
Below is the script. It indicated that it should be run in PowerShell as an Administrator.
--Sarah
# ============================================================
# Reset-WindowsSpotlight.ps1
# This script resets Windows Spotlight (the lock screen refresh feature)
# by clearing its cache, re-registering its package, and re-enabling
# the rotating lock screen background in Windows 11.
#
# IMPORTANT:
# - Run this script as Administrator.
# - Ensure no Group Policy or enterprise management is imposing
# a custom lock screen.
#
# Tested on Windows 11 24H2 (May 2025 release).
# ============================================================
# Check for Administrator privileges.
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Error "This script must be run as Administrator. Exiting."
exit 1
}
Write-Output "Starting Windows Spotlight reset process..."
# Step 1: Define paths for Spotlight cached assets and settings.
$spotlightAssetsPath = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"
$spotlightSettingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\Settings"
# Step 2: Delete cached images and settings.
if (Test-Path $spotlightAssetsPath) {
Remove-Item "$spotlightAssetsPath\*" -Force -Recurse -ErrorAction SilentlyContinue
Write-Output "Cleared Spotlight Assets: $spotlightAssetsPath"
} else {
Write-Output "Spotlight Assets folder not found at: $spotlightAssetsPath"
}
if (Test-Path $spotlightSettingsPath) {
Remove-Item "$spotlightSettingsPath\*" -Force -Recurse -ErrorAction SilentlyContinue
Write-Output "Cleared Spotlight Settings: $spotlightSettingsPath"
} else {
Write-Output "Spotlight Settings folder not found at: $spotlightSettingsPath"
}
# Step 3: Re-register the Windows Spotlight package.
Write-Output "Re-registering Windows Spotlight package..."
try {
Get-AppxPackage -allusers Microsoft.Windows.ContentDeliveryManager | ForEach-Object {
Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml" -ErrorAction Stop
}
Write-Output "Successfully re-registered Windows Spotlight."
} catch {
Write-Error "Error re-registering Windows Spotlight: $($_.Exception.Message)"
}
# Step 4: Ensure that Windows Spotlight (rotating lock screen) is enabled.
$registryPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager"
if (-not (Test-Path $registryPath)) {
New-Item -Path $registryPath -Force | Out-Null
}
# Enable the rotating lock screen background.
Set-ItemProperty -Path $registryPath -Name "RotatingLockScreenEnabled" -Value 1 -Type DWord
Write-Output "Enabled rotating lock screen background in registry."
# Step 5: Refresh group policies and system parameters.
Write-Output "Refreshing group policies and system parameters..."
try {
gpupdate /force | Out-Null
rundll32.exe user32.dll,UpdatePerUserSystemParameters ,1 ,True
Write-Output "Policies and system parameters updated."
} catch {
Write-Warning "Unable to fully refresh system parameters. A restart may be required."
}
Write-Output "Windows Spotlight reset process complete."
Write-Output "Please restart your computer to ensure all changes take effect."
My Computer
System One
-
- OS
- Windows 11
- Computer type
- Laptop
- Manufacturer/Model
- HP
- CPU
- I don't know
- Motherboard
- IDK
- Memory
- IDK
- Graphics Card(s)
- Intel
- Sound Card
- ?
- Monitor(s) Displays
- 32 inches
- Screen Resolution
- IDK
- Hard Drives
- IDK
- PSU
- IDK
- Case
- HP
- Cooling
- ?
- Keyboard
- Razer
- Mouse
- Razer
- Internet Speed
- Office
- Browser
- Windows 11
- Antivirus
- ?