How to hide folders and files from Search on Windows 10 and Windows 11

How to hide folders and files from Search on Windows 10 and Windows 11 to keep your data extra secure

Here's what you need to do to hide files and folders on Windows 10 and Windows 11.

On Windows 10

1. Go to Settings (Windows key + i)
2. Go to Search
3. Go to Searching Windows

On Windows 11

1. Go to Settings (Windows key + i)
2. Go to Privacy & security
3. Go to Searching Windows

Ever want to hide a folder from Search on Windows 10 and Windows 11? Depending on storage size and contents, some folders on Windows can bog down your search with bad search results.

The problem is Windows doesn't search for hidden files and folders by default. You can pick which files and folders to include and exclude from Windows Search.

Here's what to do.

Windows Search

By default, Windows searches for items in your Desktop, Documents, Downloads, Music, Pictures and Videos folders on your PC. When you hide a folder from the search results, Windows skips that folder when searching for your desired content.

However, search on Windows depends on what setting your PC uses. Do this to see what setting your PC uses for search.

1. Go to Settings (Windows key + i)
2. Go to Privacy & security
3. Go to Searching Windows

Here, you will notice that there are two options available, Classic and Enhanced. Classic is enabled by default and searches for items in your Documents, Pictures, Music, and Desktop folders. You can change where the Classic option searches your PC by picking "Customize search locations here" to add or remove folders from search.

search on windows

To add or exclude a folder from Search on Windows, here's what to do. Click on "Customize search locations here," and from the "Indexing Options" menu, click Modify, then click the check marks next to the folders you want to select. Click OK when you are finished. search on windows

Now, Windows will search using the folders you indicated using the Classic mode on your PC. Remember, Windows will only search through the Indexed folders you indicated. If you are looking for a more comprehensive search approach on your Windows PC, there is another option.

That option is Enhanced search. Enhanced searches the contents of your entire PC, including any storage devices attached to your device. Using Enhanced, you can elect to include every folder on your PC or none. It is a more custom Windows Search

search on windows 10

To add or remove a folder from appearing in search results using the Enhanced search option, use the following directions.

Hide a folder from Search on Windows 10

Here's what you need to do to hide a folder from Enhanced search on Windows 10.

1. Go to Settings (Windows key + i)
2. Go to Search
3. Go to Searching Windows
4. Go to Excluded folders
5. Choose add an excluded folder
search on windows 10

From here, go to Add an excluded folder and pick the folder on your PC that you want to hide from search.

Search on windows 10

Click Select folder to remove that folder from appearing in your search results for your PC.

Interested in removing a folder from the list? Click the folder you want to remove and click Remove excluded folder as shown.

How to hide folders and files from Search on Windows 10 and Windows 11 - OnMSFT.com - January 28, 2022

That is how you hide a file or folder on Windows 10.

Hide a folder from Search on Windows 11

Here's what to do to hide a folder from Enhanced search on Windows 11.

1. Go to Settings (Windows key + i)
2. Go to Privacy & security
3. Go to Searching Windows

search on windows

4. Go to "Exclude folders from enhanced search" and click Add an excluded folder

SEARCH ON windows 10

5. Select the folder to hide from search. Choose Select Folder when finished.

SEARCH ON WINDOWS 10

The path of your selected folder will appear in the "Exclude folders from Enhanced search" list. This confirms that your selected folder will be hidden from search results on your PC.

If you want to unhide your folder from Enhanced search results, select three-dot menu next to the folder and click Remove.

search on windows 10

That is how you add an excluded folder for search on Windows 11.

Hide files and folders with File Explorer

Instead of navigating to another menu, you can hide individual files and folders from search on Windows from within File Explorer, here's what to do.

1. Open File Explorer
2. Go to the file or folder to hide
3. Right-click the file or folder to hide and select Properties (Alt + Enter keyboard shortcut)
SEARCH ON WINDOWS
4. On the General tab, under Attributes, check the Hidden option
search on windows
5. Click Apply when you are finished

6. **In case you are hiding a folder that contains files and subfolders, choose Apply changes to the folder, subfolders and files to protect all of your data contents. Please remember the complete path of your hidden file or folder so you can access it later!
search on windows
7. Click OK to confirm that you are applying the changes as indicated.  Click OK again when you are finished.

When you are finished, the hidden items will not be visible anymore because Windows does not include hidden files and folders in search by default. To access the hidden folder or file again, type the complete path in File Explorer and press Enter to confirm.

In case you can't remember the complete path, follow these steps.

1. Open File Explorer
2. Click on the View tab
3. Check Hidden items
search on windows

Now, you can identify, search and browse for your hidden files and folders from within File Explorer. If you want to make the file(s) or folder discoverable again, just repeat the steps above and uncheck Hidden items.

Hide files and folders with Windows PowerShell

If you hate trying to navigate menus and prefer a different option, you can also hide files and folders with Command Prompt on your PC. Here's what to do.

1. Press and release Windows key + X, then immediately press A on your keyboard.
2. Windows PowerShell will open & request administrator privileges. Click Yes to confirm.
3. With PowerShell now open, type or copy and paste the complete path to your file or folder to change to that location. Type the following command and press Enter:
Set-Location -Path C:\COMPLETEPATHTOYOURFILE
Below is an example of what the command should look like in PowerShell.
search on windows

If your hidden file or folder contains spaces, replace "C:\COMPLETEPATHTOYOURFOLDERORFILE" with the complete path to your folder or file. Please note: Quotation marks are only needed when there are spaces in the folder or file name.

4a. To hide the folder or file, type the following command & press Enter:
attrib +h C:\COMPLETEPATHTOYOURFOLDERORFILE

4b. To unhide the folder or file, type the following command & press Enter:
attrib -h C:\COMPLETEPATHTOYOURFOLDERORFILE

4c. To hide the folder, subfolder and files, use the following command & press Enter:
attrib +h /s /d

4d. To unhide the folder, subfolder and files, use the following command & press Enter:
attrib -h /s /d

search on windows
PowerShell command examples to hide and unhide folders and files

You can use these commands in Command Prompt too, except it requires a couple of different starting steps. Here's what to do.

Hide files and folders with Command Prompt from Windows PowerShell

You can open Command Prompt the conventional way or open Command Prompt directly from PowerShell.

1. Type the following command in Windows PowerShell & press Enter:
start cmd

search on windows

The most convenient part is that when you use this command, a Command Prompt window will open in the direct path of your folder or file.

2. From here, you can use the same Windows PowerShell commands used in steps #4a-4d. Here is a list of the commands:
attrib +h C:\COMPLETEPATHTOYOURFOLDERORFILE
attrib -h C:\COMPLETEPATHTOYOURFOLDERORFILE
attrib +h /s /d
attrib -h /s /d

Want to learn more about Windows Search? Microsoft has substantial documentation available for your own research.

Which method do you use to hide files and folders on Windows 10 and Windows 11? Tell us in the comments below.

More resources

Interested in seeing more Microsoft content? Be sure to check out our Reviews, Xbox section and More Topics to explore the rest of our Microsoft coverage!

Share This Post:

Older

Xbox may be working on new co-op game inspired by Capcom's Monster Hunter series

Apple's massive Q1 earnings bolstered in part by iPad sacrifice

Newer