找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 345|回复: 17

[分享] [技术] 彻底清理“主文件夹”和“图库”

  [复制链接]
发表于 昨天 18:20 | 显示全部楼层 |阅读模式
安装完系统,习惯性地删除“主文件夹”和“图库”

  • reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f874310e-b6b7-47dc-bc84-b9e6b38f5903}" /f
  • reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}" /f

[color=rgb(34, 101, 169) !important]复制代码

准备用UltraISO打开某个文件,讨厌的“主文件夹”和“图库”又出现了
有时候在某些界面,这兄弟俩跟幽灵一样跳出来,再次打开又消失了……
执行检索:
  • $guidList = @(
  •     "{f874310e-b6b7-47dc-bc84-b9e6b38f5903}", #主文件夹
  •     "{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}" #图库
  • )
  • $outputFile = "$env:USERPROFILE\Desktop\RegSearch.txt"
  • "" | Out-File $outputFile
  • function Search-RegKey {
  •     param($BasePath, $targetGuid)
  •     Get-ChildItem -Path $BasePath -Recurse -ErrorAction SilentlyContinue | ForEach-Object {
  •         $key = $_
  •         if ($key.PSChildName -match [regex]::Escape($targetGuid)) {
  •             "【$targetGuid 键名匹配】$($key.PSPath)" | Out-File $outputFile -Append
  •         }
  •         foreach($valName in $key.GetValueNames()){
  •             $valData = $key.GetValue($valName)
  •             if($valData -is [string] -and $valData -match [regex]::Escape($targetGuid)){
  •                 "【$targetGuid 数值匹配】$($key.PSPath)  值:$valName" | Out-File $outputFile -Append
  •             }
  •         }
  •     }
  • }
  • foreach($g in $guidList){
  •     Write-Host "扫描 $g |HKCU"
  •     Search-RegKey "HKCU:" $g
  •     Write-Host "扫描 $g |HKLM"
  •     Search-RegKey "HKLM:" $g
  • }
  • Write-Host "GUID检索完毕,桌面查看 RegSearch.txt"

[color=rgb(34, 101, 169) !important]复制代码

RegSearch.txt里记录的就是这哥俩残留的项,执行清理:
  • @echo off
  • chcp 936 >nul 2>&1
  • fltmc filters >nul 2>&1 || (echo 需要管理员权限运行 & pause & exit)
  • setlocal enabledelayedexpansion
  • set "HOME_GUID={f874310e-b6b7-47dc-bc84-b9e6b38f5903}"
  • set "GALLERY_GUID={e88865ea-0e1c-4e20-9aa6-edcd0212c87c}"
  • call :DelRegKey "HKLM\SOFTWARE\Classes\CLSID\%HOME_GUID%"
  • call :DelRegKey "HKLM\SOFTWARE\Classes\WOW6432Node\CLSID\%HOME_GUID%"
  • call :DelRegKey "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\%HOME_GUID%"
  • call :DelRegKey "HKLM\SOFTWARE\WOW6432Node\Classes\CLSID\%HOME_GUID%"
  • reg add "HKLM\SOFTWARE\Classes\Folder\shell\pintohome" /v AppliesTo /t REG_SZ /d "System.ParsingName:<>"::{679f85cb-0220-4080-b29b-5540cc05aab6}" AND System.IsFolder:=System.StructuredQueryType.Boolean#True" /f >nul
  • call :DelRegKey "HKLM\SOFTWARE\Classes\CLSID\%GALLERY_GUID%"
  • call :DelRegKey "HKLM\SOFTWARE\Classes\WOW6432Node\CLSID\%GALLERY_GUID%"
  • call :DelRegKey "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\%GALLERY_GUID%"
  • call :DelRegKey "HKLM\SOFTWARE\WOW6432Node\Classes\CLSID\%GALLERY_GUID%"
  • powershell -Command "taskkill /f /im explorer.exe; start explorer.exe"
  • pause
  • goto :EOF
  • :DelRegKey
  • set "RegPath=%~1"
  • echo 处理: %RegPath%
  • takeown /f "%RegPath%" >nul 2>&1
  • icacls "%RegPath%" /grant administrators:F >nul 2>&1
  • reg delete "%RegPath%" /f >nul 2>&1
  • goto :eof


[color=rgb(34, 101, 169) !important]复制代码

再次执行检索,还有几项残留,但是项减少就是成功,到此也算完成了。

强迫症可以继续看下去:
1. 在PE里打开注册表编辑器→HKLM→文件 →加载配置单元C:\Windows\System32\config\SOFTWARE,命名为OFF(随便起名)
2.手动删除第二次检索的内容(批处理容易出问题,有需要的我单独再发)
切记!切记!退出前一定要选中HKLM\OFF →文件 →卸载配置单元
特别提醒!!!不能删除 pintohome 整个项,会导致固定到快速访问功能损坏。
修改pintohome数值即可:
HKLM\WIN_SOFT\Classes\Folder\shell\pintohome
AppliesTo 的字符串值{f874310e-b6b7-47dc-bc84-b9e6b38f5903}
修改内容为:System.ParsingName:<>"::{679f85cb-0220-4080-b29b-5540cc05aab6}" AND System.IsFolder:=System.StructuredQueryType.Boolean#True

点评

https://bbs.pcbeta.com/viewthread-2076293-1-1.html  发表于 昨天 21:40
发表于 昨天 18:32 | 显示全部楼层
谢谢分享,支持一下!
回复

使用道具 举报

发表于 昨天 18:35 | 显示全部楼层
没必要吧
回复

使用道具 举报

发表于 昨天 18:35 | 显示全部楼层
支持一下!
回复

使用道具 举报

发表于 昨天 18:36 | 显示全部楼层
感谢分享
回复

使用道具 举报

发表于 昨天 18:47 | 显示全部楼层
不会删除,谢谢!
回复

使用道具 举报

发表于 昨天 19:00 | 显示全部楼层
win11 226xx,在使用“库”的过程中,删除所有的库,并自建一些自己的库文件,那个“图库”会在某次重启后不请自来。
回复

使用道具 举报

发表于 昨天 19:57 | 显示全部楼层
谢谢分享,支持一下!
回复

使用道具 举报

发表于 昨天 21:32 | 显示全部楼层
感 谢 分 享
回复

使用道具 举报

发表于 昨天 21:38 | 显示全部楼层
回复

使用道具 举报

发表于 昨天 21:51 | 显示全部楼层
感谢分享
回复

使用道具 举报

发表于 昨天 22:31 | 显示全部楼层
多谢楼主大佬分享电脑小知识啊
回复

使用道具 举报

发表于 7 小时前 | 显示全部楼层
已收藏。图库 还有 download目录啥的都很讨厌
回复

使用道具 举报

发表于 2 小时前 来自手机 | 显示全部楼层
回复

使用道具 举报

发表于 1 小时前 | 显示全部楼层
很不错,nice
回复

使用道具 举报

发表于 半小时前 来自手机 | 显示全部楼层
wwold 发表于 2026-8-23 21:38
https://bbs.pcbeta.com/viewthread-2076293-1-1.html

谢谢分享
回复

使用道具 举报

发表于 26 分钟前 | 显示全部楼层
可以试一试
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1|闽公网安备35020302032614号 )

GMT+8, 2026-8-24 07:46

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表