Install
openclaw skills install @ibiubiu233i/stop-wps-image-assoc-resetPermanently prevent WPS Office from hijacking image file associations, restore user control over default image viewers
openclaw skills install @ibiubiu233i/stop-wps-image-assoc-resetThis skill permanently disables WPS Office's image viewing module from hijacking system image file associations, solving the problem where WPS secretly changes image default openers to its own image viewer in the background.
WPS uses scheduled tasks to run in the background and modify file associations. The task names contain user-specific IDs that vary across computers, so we need to detect them dynamically.
Auto-detect and disable all WPS scheduled tasks:
# Find all WPS-related scheduled tasks
$wpsTasks = Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' }
Write-Host "Found $($wpsTasks.Count) WPS scheduled tasks:"
$wpsTasks | Select-Object TaskName, State | Format-Table -AutoSize
# Disable all WPS scheduled tasks
$wpsTasks | ForEach-Object {
try {
Disable-ScheduledTask -TaskName $_.TaskName -ErrorAction Stop
Write-Host "✅ Disabled: $($_.TaskName)"
} catch {
Write-Host "⚠️ Failed to disable: $($_.TaskName) - $($_.Exception.Message)"
}
}
Verification command:
Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' } | Select-Object TaskName, State
Expected result: All WPS scheduled tasks show status "Disabled"
WPS registers numerous image format associations (WPS.PIC.*) in the registry that need to be completely removed.
Auto-detect and delete HKCU WPS.PIC entries:
$regItems = Get-ChildItem 'HKCU:\SOFTWARE\Classes' | Where-Object { $_.PSChildName -like 'WPS.PIC*' }
Write-Host "Found $($regItems.Count) WPS.PIC registry entries"
$regItems | ForEach-Object {
try {
Remove-Item -Path $_.PSPath -Recurse -Force -ErrorAction Stop
Write-Host "✅ Deleted: $($_.PSChildName)"
} catch {
Write-Host "⚠️ Failed to delete: $($_.PSChildName) - $($_.Exception.Message)"
}
}
Auto-detect and delete HKLM WPS.PIC entries (if present):
$regItemsHKLM = Get-ChildItem 'HKLM:\SOFTWARE\Classes' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like 'WPS.PIC*' }
if ($regItemsHKLM) {
Write-Host "Found $($regItemsHKLM.Count) WPS.PIC registry entries in HKLM"
$regItemsHKLM | ForEach-Object {
try {
Remove-Item -Path $_.PSPath -Recurse -Force -ErrorAction Stop
Write-Host "✅ Deleted: $($_.PSChildName)"
} catch {
Write-Host "⚠️ Failed to delete: $($_.PSChildName) - $($_.Exception.Message)"
}
}
} else {
Write-Host "No WPS.PIC registry entries found in HKLM"
}
Verification command:
$countHKCU = (Get-ChildItem 'HKCU:\SOFTWARE\Classes' | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count
$countHKLM = (Get-ChildItem 'HKLM:\SOFTWARE\Classes' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count
Write-Host "HKCU remaining: $countHKCU, HKLM remaining: $countHKLM"
Expected result: All WPS.PIC.* registry entries are deleted, counts are 0
The core plugin file of WPS image module, located in the addons/photo folder of WPS installation directory. WPS may be installed in multiple locations, so we need to search automatically.
Auto-search and delete all photo.dll files:
# Search common installation paths
$paths = @(
"${env:ProgramFiles}\WPS",
"${env:ProgramFiles(x86)}\WPS",
"${env:LOCALAPPDATA}\WPS",
"C:\WPS",
"D:\WPS",
"E:\WPS"
)
$found = $false
foreach ($basePath in $paths) {
if (Test-Path $basePath) {
$dlls = Get-ChildItem $basePath -Recurse -Filter "photo.dll" -ErrorAction SilentlyContinue
foreach ($dll in $dlls) {
try {
Remove-Item -Path $dll.FullName -Force -ErrorAction Stop
Write-Host "✅ Deleted: $($dll.FullName)"
$found = $true
} catch {
Write-Host "⚠️ Failed to delete: $($dll.FullName) - $($_.Exception.Message)"
}
}
}
}
if (-not $found) {
Write-Host "No photo.dll files found"
}
Verification command:
$paths | ForEach-Object {
if (Test-Path $_) {
Get-ChildItem $_ -Recurse -Filter "photo.dll" -ErrorAction SilentlyContinue | Select-Object FullName
}
}
Expected result: No photo.dll files found
WPS image viewer executable file, may exist in multiple versions, needs to be automatically searched and renamed.
Auto-search and rename all photolaunch.exe files:
$paths = @(
"${env:ProgramFiles}\WPS",
"${env:ProgramFiles(x86)}\WPS",
"${env:LOCALAPPDATA}\WPS",
"C:\WPS",
"D:\WPS",
"E:\WPS"
)
$found = $false
foreach ($basePath in $paths) {
if (Test-Path $basePath) {
$exes = Get-ChildItem $basePath -Recurse -Filter "photolaunch.exe" -ErrorAction SilentlyContinue
foreach ($exe in $exes) {
try {
$newName = $exe.FullName + ".bak"
Rename-Item -Path $exe.FullName -NewName $newName -Force -ErrorAction Stop
Write-Host "✅ Renamed: $($exe.FullName)"
$found = $true
} catch {
Write-Host "⚠️ Failed to rename: $($exe.FullName) - $($_.Exception.Message)"
}
}
}
}
if (-not $found) {
Write-Host "No photolaunch.exe files found"
}
Verification command:
$paths | ForEach-Object {
if (Test-Path $_) {
Get-ChildItem $_ -Recurse -Filter "photolaunch.exe" -ErrorAction SilentlyContinue | Select-Object FullName
}
}
Expected result: No photolaunch.exe files found, only photolaunch.exe.bak
Due to Windows UserChoice registry key hash protection, scripts cannot directly modify it. Users need to manually change through the system settings interface.
Reminder content:
Optional: Restore Windows Photo Viewer If Windows Photo Viewer is not in the settings list, it may need to be restored through registry. But it's recommended to prioritize using the system settings interface.
After completion, run the following command to verify all operations have taken effect:
Write-Host "=== 1. Scheduled Tasks ==="
Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' } | Select-Object TaskName, State | Format-Table -AutoSize
Write-Host "=== 2. WPS.PIC Registry Entries ==="
$countHKCU = (Get-ChildItem 'HKCU:\SOFTWARE\Classes' | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count
$countHKLM = (Get-ChildItem 'HKLM:\SOFTWARE\Classes' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count
Write-Host "HKCU: $countHKCU, HKLM: $countHKLM"
Write-Host "=== 3. photo.dll ==="
@("${env:ProgramFiles}\WPS", "${env:ProgramFiles(x86)}\WPS", "${env:LOCALAPPDATA}\WPS", "C:\WPS", "D:\WPS", "E:\WPS") | ForEach-Object {
if (Test-Path $_) {
$dlls = Get-ChildItem $_ -Recurse -Filter "photo.dll" -ErrorAction SilentlyContinue
if ($dlls) { $dlls | Select-Object FullName }
}
}
Write-Host "=== 4. photolaunch.exe ==="
@("${env:ProgramFiles}\WPS", "${env:ProgramFiles(x86)}\WPS", "${env:LOCALAPPDATA}\WPS", "C:\WPS", "D:\WPS", "E:\WPS") | ForEach-Object {
if (Test-Path $_) {
$exes = Get-ChildItem $_ -Recurse -Filter "photolaunch.exe" -ErrorAction SilentlyContinue
if ($exes) { $exes | Select-Object FullName }
}
}
Expected verification results:
May restore after WPS update: WPS may re-register these components after updates. If you find file associations hijacked again, you need to re-execute this skill's operations.
WPS other functions unaffected: This skill only disables WPS's image viewing module. WPS's word processing, spreadsheet, presentation and other core functions are not affected.
Administrator privileges required: Some operations (especially modifying HKLM registry entries) may require administrator privileges. If you encounter permission errors, please run PowerShell as administrator.
Backup recommendation: It's recommended to record current file association settings before executing operations, so you can restore when needed.
Multiple WPS versions: WPS may install multiple versions, need to process all versions of related files.
WPS uses the following mechanisms to hijack file associations:
This skill completely blocks WPS's file association hijacking by disabling scheduled tasks, deleting registry entries, removing plugins and executable files.