禁止WPS反复篡改图片文件默认打开方式
/install stop-wps-image-assoc-reset
\r \r
Prevent WPS Image File Association Hijacking\r
\r
Overview\r
\r This 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.\r \r
Execution Steps\r
\r
Step 1: Disable WPS Scheduled Tasks\r
\r 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.\r \r Auto-detect and disable all WPS scheduled tasks:\r
# Find all WPS-related scheduled tasks\r
$wpsTasks = Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' }\r
Write-Host "Found $($wpsTasks.Count) WPS scheduled tasks:"\r
$wpsTasks | Select-Object TaskName, State | Format-Table -AutoSize\r
\r
# Disable all WPS scheduled tasks\r
$wpsTasks | ForEach-Object {\r
try {\r
Disable-ScheduledTask -TaskName $_.TaskName -ErrorAction Stop\r
Write-Host "✅ Disabled: $($_.TaskName)"\r
} catch {\r
Write-Host "⚠️ Failed to disable: $($_.TaskName) - $($_.Exception.Message)"\r
}\r
}\r
```\r
\r
**Verification command:**\r
```powershell\r
Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' } | Select-Object TaskName, State\r
```\r
\r
**Expected result:** All WPS scheduled tasks show status "Disabled"\r
\r
### Step 2: Delete WPS Image Registry Entries\r
\r
WPS registers numerous image format associations (WPS.PIC.*) in the registry that need to be completely removed.\r
\r
**Auto-detect and delete HKCU WPS.PIC entries:**\r
```powershell\r
$regItems = Get-ChildItem 'HKCU:\SOFTWARE\Classes' | Where-Object { $_.PSChildName -like 'WPS.PIC*' }\r
Write-Host "Found $($regItems.Count) WPS.PIC registry entries"\r
\r
$regItems | ForEach-Object {\r
try {\r
Remove-Item -Path $_.PSPath -Recurse -Force -ErrorAction Stop\r
Write-Host "✅ Deleted: $($_.PSChildName)"\r
} catch {\r
Write-Host "⚠️ Failed to delete: $($_.PSChildName) - $($_.Exception.Message)"\r
}\r
}\r
```\r
\r
**Auto-detect and delete HKLM WPS.PIC entries (if present):**\r
```powershell\r
$regItemsHKLM = Get-ChildItem 'HKLM:\SOFTWARE\Classes' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like 'WPS.PIC*' }\r
if ($regItemsHKLM) {\r
Write-Host "Found $($regItemsHKLM.Count) WPS.PIC registry entries in HKLM"\r
$regItemsHKLM | ForEach-Object {\r
try {\r
Remove-Item -Path $_.PSPath -Recurse -Force -ErrorAction Stop\r
Write-Host "✅ Deleted: $($_.PSChildName)"\r
} catch {\r
Write-Host "⚠️ Failed to delete: $($_.PSChildName) - $($_.Exception.Message)"\r
}\r
}\r
} else {\r
Write-Host "No WPS.PIC registry entries found in HKLM"\r
}\r
```\r
\r
**Verification command:**\r
```powershell\r
$countHKCU = (Get-ChildItem 'HKCU:\SOFTWARE\Classes' | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count\r
$countHKLM = (Get-ChildItem 'HKLM:\SOFTWARE\Classes' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count\r
Write-Host "HKCU remaining: $countHKCU, HKLM remaining: $countHKLM"\r
```\r
\r
**Expected result:** All WPS.PIC.* registry entries are deleted, counts are 0\r
\r
### Step 3: Delete photo.dll Plugin\r
\r
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.\r
\r
**Auto-search and delete all photo.dll files:**\r
```powershell\r
# Search common installation paths\r
$paths = @(\r
"${env:ProgramFiles}\WPS",\r
"${env:ProgramFiles(x86)}\WPS",\r
"${env:LOCALAPPDATA}\WPS",\r
"C:\WPS",\r
"D:\WPS",\r
"E:\WPS"\r
)\r
\r
$found = $false\r
foreach ($basePath in $paths) {\r
if (Test-Path $basePath) {\r
$dlls = Get-ChildItem $basePath -Recurse -Filter "photo.dll" -ErrorAction SilentlyContinue\r
foreach ($dll in $dlls) {\r
try {\r
Remove-Item -Path $dll.FullName -Force -ErrorAction Stop\r
Write-Host "✅ Deleted: $($dll.FullName)"\r
$found = $true\r
} catch {\r
Write-Host "⚠️ Failed to delete: $($dll.FullName) - $($_.Exception.Message)"\r
}\r
}\r
}\r
}\r
\r
if (-not $found) {\r
Write-Host "No photo.dll files found"\r
}\r
```\r
\r
**Verification command:**\r
```powershell\r
$paths | ForEach-Object {\r
if (Test-Path $_) {\r
Get-ChildItem $_ -Recurse -Filter "photo.dll" -ErrorAction SilentlyContinue | Select-Object FullName\r
}\r
}\r
```\r
\r
**Expected result:** No photo.dll files found\r
\r
### Step 4: Rename photolaunch.exe Files\r
\r
WPS image viewer executable file, may exist in multiple versions, needs to be automatically searched and renamed.\r
\r
**Auto-search and rename all photolaunch.exe files:**\r
```powershell\r
$paths = @(\r
"${env:ProgramFiles}\WPS",\r
"${env:ProgramFiles(x86)}\WPS",\r
"${env:LOCALAPPDATA}\WPS",\r
"C:\WPS",\r
"D:\WPS",\r
"E:\WPS"\r
)\r
\r
$found = $false\r
foreach ($basePath in $paths) {\r
if (Test-Path $basePath) {\r
$exes = Get-ChildItem $basePath -Recurse -Filter "photolaunch.exe" -ErrorAction SilentlyContinue\r
foreach ($exe in $exes) {\r
try {\r
$newName = $exe.FullName + ".bak"\r
Rename-Item -Path $exe.FullName -NewName $newName -Force -ErrorAction Stop\r
Write-Host "✅ Renamed: $($exe.FullName)"\r
$found = $true\r
} catch {\r
Write-Host "⚠️ Failed to rename: $($exe.FullName) - $($_.Exception.Message)"\r
}\r
}\r
}\r
}\r
\r
if (-not $found) {\r
Write-Host "No photolaunch.exe files found"\r
}\r
```\r
\r
**Verification command:**\r
```powershell\r
$paths | ForEach-Object {\r
if (Test-Path $_) {\r
Get-ChildItem $_ -Recurse -Filter "photolaunch.exe" -ErrorAction SilentlyContinue | Select-Object FullName\r
}\r
}\r
```\r
\r
**Expected result:** No photolaunch.exe files found, only photolaunch.exe.bak\r
\r
### Step 5: Remind User to Manually Set Default Applications\r
\r
Due to Windows UserChoice registry key hash protection, scripts cannot directly modify it. Users need to manually change through the system settings interface.\r
\r
**Reminder content:**\r
1. Press **Win + I** to open Settings\r
2. Go to **Apps → Default apps**\r
3. Enter file extension in search box (e.g., .jpg)\r
4. Or click "Choose defaults by file type"\r
5. Change the default application for the following extensions to desired program (e.g., Windows Photo Viewer):\r
- .jpg, .jpeg, .png, .gif, .bmp, .tiff, .ico\r
\r
**Optional: Restore Windows Photo Viewer**\r
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.\r
\r
## Verify Overall Effect\r
\r
After completion, run the following command to verify all operations have taken effect:\r
\r
```powershell\r
Write-Host "=== 1. Scheduled Tasks ===" \r
Get-ScheduledTask | Where-Object { $_.TaskName -match 'WPS|wps' } | Select-Object TaskName, State | Format-Table -AutoSize\r
\r
Write-Host "=== 2. WPS.PIC Registry Entries ===" \r
$countHKCU = (Get-ChildItem 'HKCU:\SOFTWARE\Classes' | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count\r
$countHKLM = (Get-ChildItem 'HKLM:\SOFTWARE\Classes' -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -like 'WPS.PIC*' }).Count\r
Write-Host "HKCU: $countHKCU, HKLM: $countHKLM"\r
\r
Write-Host "=== 3. photo.dll ===" \r
@("${env:ProgramFiles}\WPS", "${env:ProgramFiles(x86)}\WPS", "${env:LOCALAPPDATA}\WPS", "C:\WPS", "D:\WPS", "E:\WPS") | ForEach-Object {\r
if (Test-Path $_) {\r
$dlls = Get-ChildItem $_ -Recurse -Filter "photo.dll" -ErrorAction SilentlyContinue\r
if ($dlls) { $dlls | Select-Object FullName }\r
}\r
}\r
\r
Write-Host "=== 4. photolaunch.exe ===" \r
@("${env:ProgramFiles}\WPS", "${env:ProgramFiles(x86)}\WPS", "${env:LOCALAPPDATA}\WPS", "C:\WPS", "D:\WPS", "E:\WPS") | ForEach-Object {\r
if (Test-Path $_) {\r
$exes = Get-ChildItem $_ -Recurse -Filter "photolaunch.exe" -ErrorAction SilentlyContinue\r
if ($exes) { $exes | Select-Object FullName }\r
}\r
}\r
```\r
\r
**Expected verification results:**\r
1. All WPS scheduled tasks status is "Disabled"\r
2. WPS.PIC registry entries count is 0\r
3. No photo.dll files found\r
4. No photolaunch.exe files found\r
\r
## Important Notes\r
\r
1. **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.\r
\r
2. **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.\r
\r
3. **Administrator privileges required**: Some operations (especially modifying HKLM registry entries) may require administrator privileges. If you encounter permission errors, please run PowerShell as administrator.\r
\r
4. **Backup recommendation**: It's recommended to record current file association settings before executing operations, so you can restore when needed.\r
\r
5. **Multiple WPS versions**: WPS may install multiple versions, need to process all versions of related files.\r
\r
## Working Principle\r
\r
WPS uses the following mechanisms to hijack file associations:\r
1. **Scheduled tasks**: Periodically run background processes to check and modify file associations\r
2. **Registry entries**: Register WPS.PIC.* format file associations in HKLM and HKCU\r
3. **photo.dll plugin**: Core component of the image module\r
4. **photolaunch.exe**: Image viewer executable file\r
\r
This skill completely blocks WPS's file association hijacking by disabling scheduled tasks, deleting registry entries, removing plugins and executable files.\r
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install stop-wps-image-assoc-reset - 安装完成后,直接呼叫该 Skill 的名称或使用
/stop-wps-image-assoc-reset触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
禁止WPS反复篡改图片文件默认打开方式 是什么?
Permanently prevent WPS Office from hijacking image file associations, restore user control over default image viewers. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 0 次。
如何安装 禁止WPS反复篡改图片文件默认打开方式?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install stop-wps-image-assoc-reset」即可一键安装,无需额外配置。
禁止WPS反复篡改图片文件默认打开方式 是免费的吗?
是的,禁止WPS反复篡改图片文件默认打开方式 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
禁止WPS反复篡改图片文件默认打开方式 支持哪些平台?
禁止WPS反复篡改图片文件默认打开方式 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 禁止WPS反复篡改图片文件默认打开方式?
由 Ibiubiu233I(@ibiubiu233i)开发并维护,当前版本 v1.0.0。