Skip to content

Disable Explorer Automatic Folder Discovery

config/tweaks.json
2663  "WPFTweaksDisableExplorerAutoDiscovery": {
2664    "Content": "Disable Explorer Automatic Folder Discovery",
2665    "Description": "Windows Explorer automatically tries to guess the type of the folder based on its contents, slowing down the browsing experience. WARNING! Will disable File Explorer grouping.",
2666    "category": "Essential Tweaks",
2667    "panel": "1",
2668    "InvokeScript": [
2669      "
2670      # Previously detected folders
2671      $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
2672
2673      # Folder types lookup table
2674      $bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
2675
2676      # Flush Explorer view database
2677      Remove-Item -Path $bags -Recurse -Force
2678      Write-Host \"Removed $bags\"
2679
2680      Remove-Item -Path $bagMRU -Recurse -Force
2681      Write-Host \"Removed $bagMRU\"
2682
2683      # Every folder
2684      $allFolders = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\\AllFolders\\Shell\"
2685
2686      if (!(Test-Path $allFolders)) {
2687        New-Item -Path $allFolders -Force
2688        Write-Host \"Created $allFolders\"
2689      }
2690
2691      # Generic view
2692      New-ItemProperty -Path $allFolders -Name \"FolderType\" -Value \"NotSpecified\" -PropertyType String -Force
2693      Write-Host \"Set FolderType to NotSpecified\"
2694
2695      Write-Host Please sign out and back in, or restart your computer to apply the changes!
2696      "
2697    ],
2698    "UndoScript": [
2699      "
2700      # Previously detected folders
2701      $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
2702
2703      # Folder types lookup table
2704      $bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
2705
2706      # Flush Explorer view database
2707      Remove-Item -Path $bags -Recurse -Force
2708      Write-Host \"Removed $bags\"
2709
2710      Remove-Item -Path $bagMRU -Recurse -Force
2711      Write-Host \"Removed $bagMRU\"
2712
2713      Write-Host Please sign out and back in, or restart your computer to apply the changes!
2714      "
2715    ],