Skip to content

File Explorer Automatic Folder Discovery - Disable

config/tweaks.json
1738  "WPFTweaksDisableExplorerAutoDiscovery": {
1739    "Content": "File Explorer Automatic Folder Discovery - Disable",
1740    "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.",
1741    "category": "Essential Tweaks",
1742    "panel": "1",
1743    "InvokeScript": [
1744      "
1745      # Previously detected folders
1746      $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
1747
1748      # Folder types lookup table
1749      $bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
1750
1751      # Flush Explorer view database
1752      Remove-Item -Path $bags -Recurse -Force
1753      Write-Host \"Removed $bags\"
1754
1755      Remove-Item -Path $bagMRU -Recurse -Force
1756      Write-Host \"Removed $bagMRU\"
1757
1758      # Every folder
1759      $allFolders = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\\AllFolders\\Shell\"
1760
1761      if (!(Test-Path $allFolders)) {
1762        New-Item -Path $allFolders -Force
1763        Write-Host \"Created $allFolders\"
1764      }
1765
1766      # Generic view
1767      New-ItemProperty -Path $allFolders -Name \"FolderType\" -Value \"NotSpecified\" -PropertyType String -Force
1768      Write-Host \"Set FolderType to NotSpecified\"
1769
1770      Write-Host Please sign out and back in, or restart your computer to apply the changes!
1771      "
1772    ],
1773    "UndoScript": [
1774      "
1775      # Previously detected folders
1776      $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
1777
1778      # Folder types lookup table
1779      $bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
1780
1781      # Flush Explorer view database
1782      Remove-Item -Path $bags -Recurse -Force
1783      Write-Host \"Removed $bags\"
1784
1785      Remove-Item -Path $bagMRU -Recurse -Force
1786      Write-Host \"Removed $bagMRU\"
1787
1788      Write-Host Please sign out and back in, or restart your computer to apply the changes!
1789      "
1790    ],