From d0c8f43b5aa2a52aa7724a612ae2dc3617ad17ed Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Tue, 11 Mar 2025 17:36:06 +0100 Subject: [PATCH] feat: add tweak "Disable Explorer automatic folder discovery" --- config/tweaks.json | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/config/tweaks.json b/config/tweaks.json index 799df24a..d99fea30 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3740,5 +3740,34 @@ "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": [ + " + $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\" + $bagsMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagsMRU\" + + Remove-Item -Path $bags -Recurse -Force + Write-Host \"Removed $bags\" + + Remove-Item -Path $bagsMRU -Recurse -Force + Write-Host \"Removed $bagsMRU\" + + $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\" + } + + New-ItemProperty -Path $allFolders -Name \"FolderType\" -Value \"NotSpecified\" -PropertyType String -Force + Write-Host \"Set FolderType to NotSpecified\" + " + ], + }, }