From d0c8f43b5aa2a52aa7724a612ae2dc3617ad17ed Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Tue, 11 Mar 2025 17:36:06 +0100 Subject: [PATCH 1/5] 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\" + " + ], + }, } From 04607864b07fc1832d4ebe353495f6131c5a3083 Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Tue, 11 Mar 2025 17:56:54 +0100 Subject: [PATCH 2/5] refactor: add comments --- config/tweaks.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/tweaks.json b/config/tweaks.json index d99fea30..44bfaab3 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3749,15 +3749,20 @@ "Order": "a017_", "InvokeScript": [ " + # Previously detected folders $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\" + + # Folder types lookup table $bagsMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagsMRU\" + # Flush explorer view database Remove-Item -Path $bags -Recurse -Force Write-Host \"Removed $bags\" Remove-Item -Path $bagsMRU -Recurse -Force Write-Host \"Removed $bagsMRU\" + # Every folder $allFolders = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\\AllFolders\\Shell\" if (!(Test-Path $allFolders)) { @@ -3765,8 +3770,11 @@ 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! " ], }, From bcef9f772a63280d6d5da562b84384d46ce6da8b Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Tue, 11 Mar 2025 17:59:14 +0100 Subject: [PATCH 3/5] feat: add undo script --- config/tweaks.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/config/tweaks.json b/config/tweaks.json index 44bfaab3..248f9165 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3777,5 +3777,21 @@ 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 + $bagsMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagsMRU\" + + # Flush explorer view database + Remove-Item -Path $bags -Recurse -Force + Write-Host \"Removed $bags\" + + Remove-Item -Path $bagsMRU -Recurse -Force + Write-Host \"Removed $bagsMRU\" + " + ], }, } From 65eb2fa699c0f50cc3d2e25e8abb9cd870bf6b6c Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Tue, 11 Mar 2025 18:00:15 +0100 Subject: [PATCH 4/5] refactor: add output comment --- config/tweaks.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/tweaks.json b/config/tweaks.json index 248f9165..9a34416a 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3791,6 +3791,8 @@ Remove-Item -Path $bagsMRU -Recurse -Force Write-Host \"Removed $bagsMRU\" + + Write-Host Please sign out and back in, or restart your computer to apply the changes! " ], }, From 5f7de72e498e65be20074d4b1a4710bdf574d9b5 Mon Sep 17 00:00:00 2001 From: madkarmaa Date: Tue, 11 Mar 2025 18:07:33 +0100 Subject: [PATCH 5/5] fix: use correct registry key --- config/tweaks.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/tweaks.json b/config/tweaks.json index 9a34416a..87ed40b1 100644 --- a/config/tweaks.json +++ b/config/tweaks.json @@ -3753,14 +3753,14 @@ $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\" # Folder types lookup table - $bagsMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagsMRU\" + $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 $bagsMRU -Recurse -Force - Write-Host \"Removed $bagsMRU\" + 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\" @@ -3783,14 +3783,14 @@ $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\" # Folder types lookup table - $bagsMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagsMRU\" + $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 $bagsMRU -Recurse -Force - Write-Host \"Removed $bagsMRU\" + 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! "