Windows 卸载列表残留 SQLyog:用 PowerShell 清理注册表
记录时间:2026-05-29
适用场景:控制面板 / 设置里还能看到 SQLyog,但点击卸载报「找不到文件」
现象
在 设置 → 应用 → 已安装的应用(或「程序和功能」)里,仍能看到 SQLyog 相关条目。点击卸载时弹出错误:
Windows 找不到文件 'D:\SQLyog\Webyog SQLyog Ultimate\unins000.exe'。请确定文件名是否正确后,再试一次。
Windows 找不到文件 'D:\sqlyog\SQLyogTrial\uninst.exe'。请确定文件名是否正确后,再试一次。
软件本体或卸载程序已被手动删除、移动过盘符,或安装目录已不存在,但 Windows 卸载列表仍保留着注册表记录,于是出现这种「幽灵项」。
原因
Windows 的已安装程序列表来自注册表,主要路径:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
每个子项里有 DisplayName(显示名称)和 UninstallString(卸载程序路径)。程序被删了、路径变了,子项却还在,列表里就还能看到,一点卸载就报找不到文件。
解决思路
不需要重装 SQLyog,也无需找丢失的 unins000.exe / uninst.exe。
直接删除注册表里对应的卸载子项即可。
修改
HKLM需要 以管理员身份 运行 PowerShell。
第一步:预览要删除的项
复制整行执行,先看会命中哪些注册表项:
$roots=@('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall','HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'); foreach($root in $roots){ if(Test-Path $root){ Get-ChildItem $root | ForEach-Object { $p=Get-ItemProperty $_.PSPath -EA 0; if($p.UninstallString -match '(?i)sqlyog|webyog'){ [PSCustomObject]@{Key=$_.PSPath;DisplayName=$p.DisplayName;UninstallString=$p.UninstallString} } } } } | Format-Table -AutoSize
确认输出中的 UninstallString 正是报错路径,例如:
| DisplayName | UninstallString |
|---|---|
| SQLyog Ultimate | D:\SQLyog\Webyog SQLyog Ultimate\unins000.exe |
| SQLyog Trial | D:\sqlyog\SQLyogTrial\uninst.exe |
第二步:精确删除(推荐)
只删除路径匹配上述两条的记录,避免误删其他 Webyog 软件:
$patterns=@('(?i)\\Webyog SQLyog Ultimate\\unins000\.exe','(?i)\\SQLyogTrial\\uninst\.exe'); $roots=@('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall','HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'); foreach($root in $roots){ if(Test-Path $root){ Get-ChildItem $root | ForEach-Object { $p=Get-ItemProperty $_.PSPath -EA 0; $u=[string]$p.UninstallString; if($patterns | Where-Object { $u -match $_ }){ Write-Host "Deleting: $($p.DisplayName) -> $($_.PSPath)"; Remove-Item -LiteralPath $_.PSPath -Recurse -Force } } } }
备选:删除所有 SQLyog / Webyog 残留项
若预览时发现多条相关记录、想一并清理,可用:
$roots=@('HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall','HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'); foreach($root in $roots){ if(Test-Path $root){ Get-ChildItem $root | ForEach-Object { $p=Get-ItemProperty $_.PSPath -EA 0; if($p.UninstallString -match '(?i)sqlyog|webyog'){ Write-Host "Deleting: $($p.DisplayName) -> $($_.PSPath)"; Remove-Item -LiteralPath $_.PSPath -Recurse -Force } } } }
第三步:验证
- 注销或重启一次(让卸载列表刷新)
- 打开 设置 → 应用 → 已安装的应用
- 确认 SQLyog 相关条目已消失
若仍在,重新执行第一步预览,把完整输出对照 UninstallString 再删。
注意事项
| 事项 | 说明 |
|---|---|
| 管理员权限 | 删 HKLM 下项必须管理员 PowerShell |
| 只删子项 | 删除的是 Uninstall 下的具体子文件夹,不要删整个 Uninstall 键 |
| 以路径为准 | DisplayName 为空时,以 UninstallString 判断 |
| 本质 | 这是清理列表残留,不是真正卸载已不存在的程序 |
| 备份(可选) | 不放心可先在 regedit 里导出相关分支备份 |
手动方式(不用 PowerShell)
Win + R→ 输入regedit→ 回车Ctrl + F搜索unins000.exe或SQLyogTrial- 找到
UninstallString对得上的子项 → 右键删除 - 注销或重启后检查卸载列表
小结
SQLyog 卸载报「找不到文件」,通常是 注册表卸载项未清理。用 PowerShell 按 UninstallString 定位并删除对应子项,即可让残留条目从卸载面板消失。本文所用精确删除命令已在实际环境验证通过。