Skip to content

File Explorer Automatic Folder Discovery - Disable

config/tweaks.json
1187  "WPFTweaksDisableExplorerAutoDiscovery": {
1188    "Content": "File Explorer Automatic Folder Discovery - Disable",
1189    "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.",
1190    "category": "Essential Tweaks",
1191    "panel": "1",
1192    "InvokeScript": [
1193      "
1194      # Previously detected folders
1195      $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
1196
1197      # Folder types lookup table
1198      $bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
1199
1200      # Flush Explorer view database
1201      Remove-Item -Path $bags -Recurse -Force
1202      Write-Host \"Removed $bags\"
1203
1204      Remove-Item -Path $bagMRU -Recurse -Force
1205      Write-Host \"Removed $bagMRU\"
1206
1207      # Every folder
1208      $allFolders = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\\AllFolders\\Shell\"
1209
1210      if (!(Test-Path $allFolders)) {
1211        New-Item -Path $allFolders -Force
1212        Write-Host \"Created $allFolders\"
1213      }
1214
1215      # Generic view
1216      New-ItemProperty -Path $allFolders -Name \"FolderType\" -Value \"NotSpecified\" -PropertyType String -Force
1217      Write-Host \"Set FolderType to NotSpecified\"
1218
1219      Write-Host Please sign out and back in, or restart your computer to apply the changes!
1220      "
1221    ],
1222    "UndoScript": [
1223      "
1224      # Previously detected folders
1225      $bags = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\Bags\"
1226
1227      # Folder types lookup table
1228      $bagMRU = \"HKCU:\\Software\\Classes\\Local Settings\\Software\\Microsoft\\Windows\\Shell\\BagMRU\"
1229
1230      # Flush Explorer view database
1231      Remove-Item -Path $bags -Recurse -Force
1232      Write-Host \"Removed $bags\"
1233
1234      Remove-Item -Path $bagMRU -Recurse -Force
1235      Write-Host \"Removed $bagMRU\"
1236
1237      Write-Host Please sign out and back in, or restart your computer to apply the changes!
1238      "
1239    ],