While Windows 11 boasts impressive search capabilities, you may want to exclude specific files or folders from appearing in results. Reasons for this could range from protecting personal data to preventing accidental deletion or maintaining search efficiency.

This guide explores various methods for hiding and showing files, folders, drives, file types, and more on Windows 11. Whether you prefer the familiar File Explorer or the control offered by Settings, we'll guide you through each option.

Why Hide Files and Folders? Before diving into the methods, let's understand why you might want to hide content from search:

  • Security: Protect private or sensitive information from unauthorized access.
  • Organization: Prevent accidental deletion or clutter search results with irrelevant content.
  • Performance: Exclude large folders or complex files that slow down search speed.

Methods to Hiding Files and Folders in Windows 11

There are several ways you can hide files, folders, and drives from Windows search and the File Explorer search in Windows 11. These methods include using Settings, Indexing Options, File Explorer, Command Prompt, and more.

Hide Files and Folders using Settings in Windows 11

When you search for a file or folder in the Windows search, it automatically searches for items in your Documents, Pictures, Music, and Desktop, and other folders under your current user profile folder.

So if you want to hide a specific file or folder from appearing in search results, you need to exclude that folder or the folder containing the file from the search. To hide specific folders from Windows Search, follow these steps:

Right-click on the Start Menu and select ‘Settings’ or you can use the Windows+I shortcut to open the Settings app.

In Windows Settings, click ‘Privacy & security’ on the left sidebar, and select ‘Searching Windows’ tile on the right pane as shown in the image below.

Under the ‘Find my files’ section of the Searching Windows page, there are two options on where to search for files:

  • Classic – It is the default option for returning search results. If enabled, this methods search for files and folder in the User profile folder only, including Documents, Pictures, Music, Downloads, Videos, and the Desktop.
  • Enhanced – This option searches your entire computer, including all hard drives, partitions, libraries, and the desktop.

Both options will also return apps, settings, features, other system content for your searches.

Under the ‘Exclude folders from enhanced search’, you will see the list of folders that won’t be included when searching your PC. By default, the system folders such as ProgramData, Windows, AppData, and others won’t be included in the search.

To exclude a specific folder from the search, click the ‘Add an excluded folder’ button under the Exclude folders from the enhanced search section.

Next, in the Select Folder window, navigate to the folder you want to exclude from Windows Search and select it. Then, click the ‘Select Folder’ button.

To remove a folder from the excluded folders list, simply click on the vertical ellipse (three dots) next to the folder and select ‘Remove’.

When you hide a folder, Windows will stop searching for that folder as well as its content.


Hide Files and Folders from Windows 11 Search using Indexing Options

Indexing is a Windows service that catalogues information about the files, folders, email messages, and other content stored on computers to improve the searching performance on the PC. When you add new files or make modifications to the existing one, Windows automatically updates its indexes with the properties of the files such as file names, file types, file full path, etc.

Excepting a particular folder will hide that folder from Windows 11 search results. Here’s how you can do this:

First, search for ‘Indexing Options’ in the Windows search and click the first result to open the Indexing Options dialog box.

Alternatively, you can click ‘Advanced indexing options’ under the Related settings section at the bottom of the Searching Windows settings page (from the above section).

In the Indexing Options dialog, you can see all the included locations (drives, folders) where Windows will search. If the drive or the folder or the drive that contains the folder that you’re trying to hide is listed under the ‘Included locations’, it will be found in the Window search.

To exclude a folder or the drive, click the ‘Modify’ button.

This will open another Indexed Location dialog box. Here all the select folders and drives are included in the Index. And all the deselected folders and drives are excluded from the Index. To hide a folder, you need to exclude it from the Index. You can double-click on a drive or the arrow next to the drive name to see the tree list of folders.

Now, simply deselect folders that you don’t want to see in Windows search results. When you deselect a folder, it will appear under the ‘Exclude’ section below. Then, click ‘OK’.

Here’s we are deselecting the ‘My project’ folder to hide it from the search results.

When you return to the main Indexing Options dialog box, click the ‘Advanced’ button. 

To access the Advanced Options, you will need admin rights. If you are not logged into an administrator account, you will need to enter the admin credentials to open the Advanced options box.

Next, click the ‘Rebuild’ button under the Troubleshooting section.

Then, click the ‘OK’ button in the confirmation box to rebuild the index. However, the process will take some time to finish it

Once the indexing is complete, the folder will not show up in the Windows search result.


Hide Specific File Types from Search Results in Windows 11

Windows 11 also allows you to hide specific file types from search results. For instance, you have several banking documents all in ‘.pdf’ format and you don’t want anyone to find those files. To do that, you can add the ‘.pdf’ file type to the exclusion list in the Search Index, which will prevent the Windows search from searching for PDF files. Here’s how you do this:

Open the Start menu, search for ‘Indexing Options’ in the Windows search and click the first result to open the Indexing Options dialog box.

When the Indexing Options window opens, click the ‘Advanced’ button at the bottom.

In the ‘Advanced Options’ window, switch to the ‘File Types’ tab. Here, you can see the list of all file extensions supported by Windows that will show in the Windows search.

To exclude a file type from the index, deselect it from the list, and click ‘OK’. Here, we’re are excluding PDF files.

If the file format that you want to hide is not listed here, enter your file extension in the ‘Add New Extension to List’ field at the bottom and click ‘Add’ to add it to the list.

Then, switch back to the ‘Index Settings’ page, and click the ‘Rebuild’ next to Delete and rebuild index.

Then, click ‘OK’ to the Rebuild Index prompt box to begin rebuilding the index.

It will take some time to finish the indexing process depending upon the number of files on your system. After that, no PDF files file will appear in the Window search no matter where they are located on the computer.

After the indexing is complete, click the ‘Close’ button.

Then, you can try searching that file format (.pdf) and you will only get web results for your search and nothing from your local drive.

To show the files types in the Windows search again, open the ‘Indexing Options’ dialog again and click the ‘Advanced’ button.

In the Advanced Options dialog box, go to the ‘Files Types’ tab and check the deselected file type from the list of extensions. Then, click the ‘OK’ button.


Hide Files and Folders using the File Explorer in Windows 11

Another easy way to hide any file and folder in Windows 11 is using File Explorer. This is one of the easiest and simplest methods to hide content in nearly all Windows versions. By applying a hidden attribute to the folder properties, you can keep the folder, all its subfolders and all files or just only the folder hidden. Unlike the above methods, you can also hide individual files by applying hidden attributes. Here’s how you do this:

First, open the File Explorer and navigate to the file or folder you want to hide. Then, right-click the folder and select ‘Properties’.

In the Properties dialog box, go to the ‘General’ tab and check the ‘Hidden’ option. Then, click the ‘Apply’ button.

When you click the ‘Apply’ button, you will be asked whether you are hiding the selected folder only or all the subfolder and files contained within that folder as well. If you’re hiding a folder with all the files and subfolders, then, select the ‘Apply changes to this folder, subfolders, and files’ option and click ‘OK’. If you’re only hiding folder but not its contents, select ‘Apply changes to this folder only’.

Then, click ‘OK’ again to close the Properties dialog.

Once you’ve completed the above steps, the selected folder will be hidden (If Folder Options is set to ‘Don’t show hidden files, folder, or drives’).

If the folder or file appear as faint icons or ghost icons but not hidden, click the ‘See more’ button at the top and select ‘Options’.

In the Folder Options dialog window, go to the ‘View’ tab and make sure to select the ‘Don’t show hidden files, folders, or drives’ option under Advanced settings. Then, click ‘Apply’ and ‘OK’.

Once you do that the folder will be gone (hidden).

You can also hide a file using the same above steps. Right-click the file you want to hide and select ‘Properties’ from the context menu.

Then, check the ‘Hidden’ option, then select ‘Apply’ and ‘OK’.


Hide an Entire Drive in Windows 11

Just like folders and files, you can also hide an entire drive in Windows 11 but with help of the Disk management console. Disk Management is a Windows console that allows you to perform various functions such as partitioning devices, managing drives, disk checking, disk formatting, etc. Follow these steps to hide drivers in Windows 11:

For instance, we want to hide the drive named ‘Secrets’ in the below screenshot.

First, right-click the Start menu and select ‘Disk Management’ or open the Run dialog box and type Diskmgmt.msc and press Enter.

When the Disk Management utility opens up, right-click on the drive you want to hide and select the option ‘Change drive letter and paths …’ option. Also, make sure to select the correct drive from the correct disk (if you have multiple hard disks connected to your computer).

This will open a small dialog box. Now select the drive letter in that dialog box and click on the ‘Remove’ button.

When you see the Disk Management warning box, just ignore the warning and click the ‘Yes’ button.

When you open the file explorer again, you will see that the drive (Secrets) is not visible.


Hide Files and Folders using the Command Prompt in Windows 11

If you are a power user, you may like to use a Command prompt to hide a folder or a folder instead of the graphical interface.

First, open a Command Prompt window with administrative privileges. To do that search for ‘Command prompt’ or ‘cmd’ and click ‘Run as Administrator’ from the right side.

When the CMD opens up, use the ‘cd’ command to navigate the directory (folder) or file you want to hide.

For instance, we want to navigate to the below folder. To change the drive and directory to a specific folder from another drive, run the below command and press Enter:

cd /d K:\My Secret Societies

In the above command, the cd is used to change the directory, and the /d parameter is used to change the current drive to a specific folder from another drive. And K:\ My Secret Societies is the path of the folder.

Then, you can use the dir command to view the content of the current directory.

To hide a file or folder (directory), type the following command:

attrib +h "Name of the file or directory"

Here, replace the Name of the file or directory with the file name or the folder name, you want to hide.

Example:

attrib +h "Illuminati Files"

The above command adds a hidden attribute to the directory named ‘Illuminato Files’.

Once you execute the above command, it hides that particular file or folder. As you can see when we run the dir command again to check the contents of the directory, that folder (Illuminati Files) is not available, hence it’s hidden.

However, if you are trying to hide the folder as well as its subfolders and files, then you will need to run the below commands:

First, run the following command to navigate inside the hidden folder:

cd "Illuminati Files"

Where replace Illuminati Files with the name of your hidden folder.

Once you’re inside the hidden directory, enter the below command to hide all files and folders inside the hidden folder and press Enter:

attrib +h /s /d

If you think you navigated to the wrong directory, use the cd.. command to go back to the previous folder.


Hide Drives using Command Prompt in Windows 11

You can also hide an entire drive or a volume using Command Prompt. Here’s how:

First, open the Command prompt and run diskpart to open the Diskaprt utility. Diskpart is a command-line disk partitioning utility that allows users to manage disks, drives, partitions, or volumes in Window computer.

Or you can simply search for ‘Diskpart’ in the Windows search and open it.

The Diskpart utility will launch in a separate CMD-like window as shown below. However, if you run the dispart command in a CMD with admin rights, it will launch in the same window.

Now, let us see how many drives or volumes are available on the computer. To do that, just enter the below command:

list volume

Once you have the list of drives, confirm the volume number of the drive you want to hide.

Next, select the drive that you want to hide using the below command:

select volume number

Where replace ‘volume number’ with the volume number of the drive that you want to hide. Here, we want to hide the drive named ‘Secrets’, so we are selecting ‘Volume 12’:

select Volume 12

or

sel vol 12

To hide the selected drive, run the below command:

remove letter=L

Where replace L with the letter of the drive you want to hide.

Once the drive letter is removed, that drive will be hidden from File Explorer.


Methods to Show or Unhide Hidden Files and Folders in Windows 11

Just as there are several ways to hide files, folders, and drives in Windows 11, there are several ways to show or unhide hidden files and folders too.

Unhide Hidden Files and Folders using Indexing Options in Windows 11

If you excluded folders and drives from being indexed, you can include them to show the hidden files, folders, and drives in the Windows search again. Here’s how you can show/unhide hidden files and folders using Indexing options.

Open the Start menu, search for ‘Indexing Options’ in the Windows search and click on the first result to open the Indexing Options dialog box.

In the Indexing Options windows, you can see the list of the excluded folders (which are hidden from the search) under the ‘Exclude’ section. Now, click the ‘Modify’ button at the bottom.

Now, navigate to the excluded folder or drive and check it. Once you select the folder, it will be removed from the Exclude section. Then, click ‘OK’.

Back in the Indexing Options window, click the ‘Advanced’ button.

Then, select the ‘Rebuild’ button in the Advanced Options dialog box to rebuild the index.


Show/Unhide Hidden Files and Folders in File Explorer in Windows 11

If you want to show the hidden folder and files or unhide the files and folders in the File Explorer, follow these instructions:

Click the File Explorer icon on the taskbar or press Windows+E on your keyboard to launch File Explorer. When the File Explorer opens, click the ‘horizontal three-dots’ (See more) button at the top and select ‘Options’.

Alternatively, you can also search for ‘File Explorer Options’ in the Windows search and select the top result to launch the ‘File Explorer Options’ dialog window.

In the Folder Options dialog, go to the ‘View’ tab. Then, select ‘Show hidden files, folders, and drives’ under Advanced settings. After that, click ‘Apply’ and select ‘OK’.

The hidden files and folders will now be visible in the File Explorer but the folder or file icon will be in dim color (as if it is barely visible) as shown below. This means the file or folder is visible but they are still hidden.

You can also use the options from File Explorer’s new ribbon to show hidden files and folders. Click the ‘View’ button in the File Explorer’s ribbon, expand the ‘Show’ option and click the ‘Hidden items’ (tick) option.

To fully unhide the files and folders in the File Explorer, right-click the hidden file or folder and select ‘Properties’.

In the Properties dialog, uncheck the ‘Hidden’ option and click ‘Apply’. Then, click ‘OK’ to close the dialog. This will remove the hidden attribute from the file or folder.

Once you click the ‘Apply’ button, you will be asked whether you are applying the changes folder only or folder, all the subfolders, and files. If you’re unhiding a folder with all the files and subfolders, then, select the ‘Apply changes to this folder, subfolders, and files’ option, and click ‘OK’. Then, click ‘OK’ on the Properties dialog.

If you are only unhiding the folder but not its content, then select ‘Apply changes to this folder only’. If you are unhiding a file, follow the same instructions.


Access Hidden Files using Direct File Path

There’s another way you can access the files inside a hidden folder. However, it only works if you know the exact path to that folder and the exact folder name. You can access the files within a hidden folder by entering the full exact folder path in the address bar of the File Explorer. But the files inside the hidden folder should not have hidden attributes otherwise it won’t work.

To do this, launch the File Explorer and type the exact hidden folder path in the address field at the top, and press Enter.


Unhide an Entire Drive in Windows 11

Unhiding a drive is just as easy as hiding the drive in Windows 11. Here’s how you do it:

First, search for ‘Disk Management’ in the Windows search and open the top result.

On the Disk Management utility, right-click on the drive you want to unhide and select the ‘Change Drive Letter and Paths..’ option from the context menu.

Now, click the ‘Add’ button to assign a letter to the drive.

In the Add Drive Letter or Path dialog box, choose a drive letter from the drop-down and click ‘OK’.

Once you assign a drive letter to the drive, it will be available in the File Explorer.


Unhide Files and Folders using Command Prompt in Windows 11

If you want to unhide files and folders using the Command prompt, follow these steps:

Open Command Prompt and use the ‘cd’ command to navigate the directory (folder) or file you want to unhide. For instance, the below command navigates to a folder named ‘My Secret Societies’ in the ‘K’ drive:

cd /d K:\My Secret Societies

Here, the /d parameter or switch is used to change the current drive to a specific folder in another drive.

To unhide a file or folder (directory), type the following command and press Enter:

attrib -h "Name of the file or directory"

Here, replace the Name of the file or directory with the file name or the folder name, you want to unhide.

Example:

attrib -h "Spectre Files"

However, the above command only unhides and shows the specified folder, it will not unhide the subfolders and files within that folder. To do that, you will need to use the below commands:

Type the below command to navigate inside the unhidden folder:

cd Folder_Name

Where replace Folder_Name with the name of your folder.

cd Spectre Files

If you are not sure that if the current directory contains any hidden folders or files, try the below command to view all the hidden files and folders within that folder:

dir /ah

Then, type the following command to unhide all files and folders inside the folder:

attrib -h /s /d

This command will unhide all the subfolders and files inside the folders.


Unhide Drives using the CMD in Windows 11

If you want to unhide a hidden drive or a volume using the command prompt (CMD), follow these steps:

Open the Command prompt, type diskpart and press Enter to launch the Diskaprt utility.

Now, let us see how many drives or volumes are available on the computer. To do that, just enter the below command:

list volume

Once you get the list of drives, confirm the volume number of the drive you want to unhide. As you can see the ‘Volume 12’ is missing the driver letter because it was removed, hence it’s hidden.

Remember, the system and recovery drives will not have letters too. If any other drive doesn’t have a letter, it’s because it’s either removed or hasn’t been assigned yet.

Next, select the drive that you want to unhide with the following command:

select volume 12

To assign a drive letter to a volume or a drive, simply type the following command and press Enter:

assign letter=x

Here, replace X with the letter of the drive you want to unhide.

Now, the drive will be available in File Explorer.


How to Hide Recent Files And Folders in Windows 11

Let’s assume you recently accessed your hidden files and folder and hid them again, yet the people who have access to your computer can still easily access them through the ‘Quick access’ in File Explorer and ‘Recommended section’ in the Start menu. Quick Access is an area in the File Explorer which gives you faster access to your most frequently used folders and recently used files. Even after hiding your files, others who have access to your computer can still learn what files did you use recently and where they are located.

To fix this, you can remove the recently accessed files from the list, disable recent files from Quick Access, disable recent items from the Start menu, or clear File Explorer history.

Removing Specific Recent Files or Folders from the Quick Access

When you open Quick access, you will see the list of every file and folder that has been accessed recently or several times including the hidden files. You can manually remove the individual items from the Recent Items section or the Folders section to hide the recent files and folders.

Open File Explorer and go to the Quick access area. Here, right-click on a file you want to remove under the ‘Recent files’ section and select the ‘Remove from Quick access’ option.

If you want to remove a frequently used folder, right-click on the folder and select the ‘Remove from Quick access’ option.


Your recently opened files (hidden) can appear in the Recommended section of the Start menu. To hide your recently opened hidden files, you have to remove them from the Recommended section individually.

To do this, first, close all the files and programs and open the ‘Start’ menu. Then, right-click on a specific item you want to remove from the ‘Recommended Section’ and select ‘Remove from list’.

To remove all the recent files and folders, open File Explorer and go to the ‘Users’ folder in the C drive. Then, open your user profile folder and open ‘Appdata’. If the Appdata folder is not visible, click the ‘View’ button in the File Explorer’s ribbon, expand the ‘Show’ option and select the ‘Hidden items’ option.

Then navigate to the following location.

AppData\Roaming\Microsoft\Windows

Here, locate and double-click on ‘Recent Items’.

In the Recent Items folder, you will see a complete list of the recently used files and folders. You can either select only the specific files or all the recent files and folders and delete them from the list.


Clear File Explorer History in Windows 11

You can also clear the File Explorer History to remove all the recently accessed files and folders from the Quick access.

To clear your file explorer history in Windows 11, open File Explorer and click on the ‘See more’ (three-horizontal dots button). Then, select ‘Options’ from the menu.

In the General tab of the File Explorer Options, click the ‘Clear’ button under the Privacy section. Then, click ‘OK’ to close the folder options.

Once you click the ‘Clear’ button, everything is removed from your file explorer history including the files under the ‘Recent items’ in Quick access.


Disable Recently Used Files/Frequently Used Folders in Quick Access

If you access your hidden files and folders after clearing File Explorer history, Quick access will keep track of all the recently accessed files and frequently used folders again. To prevent that, you can fully disable recent history in Quick access. Here’s how you do this:

First, close all the opened files and folders (hidden) and search for the ‘File Explorer Options’ control panel, and select the top result. Or you can open the File Explorer Options dialog box from the File Explorer ribbon as you did above.

In the General tab, uncheck the below-mentioned options under the Privacy section:

  • Show recently used files in Quick access
  • Show frequently used folders in Quick access

Then, click ‘Apply’ and ‘OK’.

Once you do that you will no longer see the recently accessed files and frequently used folders in the Quick Access area.


Disable Recently Opened Items from the Start Menu

If you want to disable the recently opened (hidden) items from showing up in the Recommended section of the Start menu, follow these steps:

Close all the opened files, folders, and program and open Settings. To do that, click the Start menu and select ‘Settings’.

In the Settings app, click on ‘Personalization’ on the left panel and select the ‘Start’ option on the right.

In the Start settings page, turn off the toggle next to ‘Show recently opened items in Start, Jump lists, and File Explorer’.

This will stop Windows from keeping track of your recent files and folders that include the hidden files.


With various methods available, you can easily hide and show files and folders in Windows 11. Choose the approach that best suits your needs and preferences.