mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-05-24 00:07:24 -05:00
feat: disable explorer automatic folder discovery (#3262)
* feat: add tweak "Disable Explorer automatic folder discovery" * refactor: add comments * feat: add undo script * refactor: add output comment * fix: use correct registry key
This commit is contained in:
parent
425f11d787
commit
7769a328bb
@ -3758,5 +3758,60 @@
|
||||
"Type": "Button",
|
||||
"ButtonWidth": "300",
|
||||
"link": "https://christitustech.github.io/winutil/dev/tweaks/Performance-Plans/RemoveUltPerf"
|
||||
},
|
||||
"WPFTweaksDisableExplorerAutoDiscovery": {
|
||||
"Content": "Disable Explorer automatic folder discovery",
|
||||
"Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience.",
|
||||
"category": "Essential Tweaks",
|
||||
"panel": "1",
|
||||
"Order": "a017_",
|
||||
"InvokeScript": [
|
||||
"
|
||||
# Previously detected folders
|
||||
$bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
|
||||
|
||||
# Folder types lookup table
|
||||
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
|
||||
|
||||
# Flush explorer view database
|
||||
Remove-Item -Path $bags -Recurse -Force
|
||||
Write-Host \"Removed $bags\"
|
||||
|
||||
Remove-Item -Path $bagMRU -Recurse -Force
|
||||
Write-Host \"Removed $bagMRU\"
|
||||
|
||||
# Every folder
|
||||
$allFolders = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\\AllFolders\\Shell\"
|
||||
|
||||
if (!(Test-Path $allFolders)) {
|
||||
New-Item -Path $allFolders -Force
|
||||
Write-Host \"Created $allFolders\"
|
||||
}
|
||||
|
||||
# Generic view
|
||||
New-ItemProperty -Path $allFolders -Name \"FolderType\" -Value \"NotSpecified\" -PropertyType String -Force
|
||||
Write-Host \"Set FolderType to NotSpecified\"
|
||||
|
||||
Write-Host Please sign out and back in, or restart your computer to apply the changes!
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
# Previously detected folders
|
||||
$bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
|
||||
|
||||
# Folder types lookup table
|
||||
$bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
|
||||
|
||||
# Flush explorer view database
|
||||
Remove-Item -Path $bags -Recurse -Force
|
||||
Write-Host \"Removed $bags\"
|
||||
|
||||
Remove-Item -Path $bagMRU -Recurse -Force
|
||||
Write-Host \"Removed $bagMRU\"
|
||||
|
||||
Write-Host Please sign out and back in, or restart your computer to apply the changes!
|
||||
"
|
||||
],
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user