This repository contains a PowerShell script to disable the folder discovery feature in Windows 10/11. Folder discovery automatically customizes the look and feel of File Explorer based on the content of the folders. By running this script, you can ensure that File Explorer always displays files in the default view.
Windows 11's folder discovery feature can be helpful for some users, but it can also be a nuisance for others who prefer a consistent view across all folders.
This script modifies the Windows Registry to disable this feature, forcing File Explorer to use a default view for all folders.
The script performs the following actions:
- Deletes the
BagsandBagMRUkeys in the registry if they exist. - Creates a new
Bagskey. - Creates a new
AllFolderskey inside theBagskey. - Creates a new
Shellkey inside theAllFolderskey. - Adds a
FolderTypestring value inside theShellkey and sets its data toNotSpecified.
By setting the FolderType to NotSpecified, Windows 11 is instructed not to apply any special folder view settings based on content.
- Windows 10 or 11
- PowerShell (Run as Administrator)
Before running the script, it's recommended to back up the relevant registry key to avoid any potential issues. Follow these steps to back up the registry key:
- Press
Win + R, typeregedit, and pressEnterto open the Registry Editor. - Navigate to the following path:
HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell
- Right-click on the
Shellkey and selectExport. - Choose a location to save the backup file and give it a name.
- Click
Save.
- Clone the repository or download the script file
DisableFolderDiscovery.ps1.
git clone https://github.com/MagnusJohansson/disable-folder-discovery.git-
Open PowerShell as an Administrator.
-
Navigate to the directory containing the DisableFolderDiscovery.ps1 script.
cd path\to\DisableFolderDiscovery- Run the script.
./DisableFolderDiscovery.ps1You can restart File Explorer by opening Task Manager, finding "Windows Explorer" in the list, and clicking "Restart".
This script modifies the Windows Registry. It is recommended to back up the relevant registry keys before running the script. Use this script at your own risk. The author is not responsible for any potential damages or issues that may arise from using this script.
Contributions are welcome!
Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
If you find this project helpful, consider supporting my efforts by buying me a coffee. Your support helps me keep the project alive and continuously improve it. Thank you!
