If you have some files and folders that you want to keep safe from prying eyes, you might want to hide them so others can’t access them easily. Luckily, Windows allows you to hide all kinds of items, using only built-in tools like File Explorer or commands run in PowerShell or Command Prompt. In this guide, I show you how to hide both files and folders in Windows 10 and Windows 11:
If you’re using Windows 10, open File Explorer and navigate to the file or folder you want to hide. I chose to hide a file from my desktop.
Right-click or press and hold on the file or folder and, in the menu that appears, click or tap Properties. You can also select the file/folder and press ALT + Enter on your keyboard to achieve the same result.
You see the Properties window for the selected file or folder. Then, in the General tab, check the Hidden box, and click or tap OK.
If you set a file as hidden, the change is applied immediately.
If you set a folder as hidden, you see a prompt named “Confirm Attribute Changes.” Next, you’re asked whether you want to apply the change only to the folder or also its subfolders and files. Most users will probably want the second option, “Apply changes to this folder, subfolders and files.” Select the option you prefer and press OK twice.
The change is applied according to your choice. After setting the file or folder as hidden, its icon is grayed out to signal the attribute change.
To completely hide this file from view, as well as all other hidden files or folders, click or tap the View tab in File Explorer and deselect the “Hidden items” option.
TIP: If you want to password-protect a folder, read this guide: 8 tools to password-protect your folders in Windows.
If you’re using Windows 11, the steps are the same as the ones in Windows 10, but the File Explorer window looks different. Therefore, I think it’s best to have a dedicated section for the users of this operating system. Start by opening File Explorer (Windows + E) and navigating to the file or folder you want to hide. Next, select it and press ALT + Enter on your keyboard or right-click (or press and hold) on it and choose Properties in the context menu.
In the Properties window of the selected file or folder, check the Hidden box in the General tab, and click or tap OK.
If you change the attributes of a folder, you’re also asked to confirm whether you want to apply the Hidden attribute to this folder only or its subfolders and files too. Most people prefer to choose “Apply changes to this folder, subfolder and files.” After making your choice, press OK twice, and you’re done.
The selected file or folder is marked as hidden, and its icon becomes grayed out. To completely hide it from view, click or tap the View button at the top, choose Show, and then deselect the Hidden items option in the File Explorer window.
All hidden files and folders are no longer shown in Windows 11.
TIP: If you want to create a password-protected ZIP file that others can’t open, read this guide: 2 ways to create a password-protected ZIP file in Windows.
Open Command Prompt as administrator and then run this command:
Replace “path to file or folder” with the actual path towards the file or folder you want to hide, similar to the screenshot below.
After you press Enter, that file or folder is marked as hidden.
NOTE: According to other websites on the internet and Microsoft’s documentation, for the attrib command, you should add the “/s /d” parameters to the command shared earlier so that it applies to a folder, all its subfolders, and files. Unfortunately, I’ve tested this in Windows 10 and Windows 11, and it doesn’t work. If you’re using these parameters on a folder, only the folder is set as hidden. The files and subfolders inside that folder remain as they are.
You should replace “path to file” with the actual path to the file you want to hide and “filename.extension” with the exact name and extension of the same file, like in the screenshot below.
If you want to hide a folder, the command is identical:
Replace ”path to folder” with the actual path towards your folder. See the screenshot below for an example.
If you also want to set all the files and subfolders inside your folder as hidden, you should also run this command alongside the previous two:
Things should look similar to the screenshot below.
PowerShell runs these commands without providing any feedback. If you typed everything correctly, all the items you chose should be marked by Windows as hidden. If File Explorer is set to “Don’t show hidden files, folders, or drives,” these items should no longer be visible.
TIP: If you want to hide more than just files and folders, here’s how to hide (or unhide) any partition in Windows.
It doesn’t matter whether you’re using Windows 10 or Windows 11. The methods for hiding files and folders work the same, even if the user interface looks slightly different. Tell me which method you used and whether it worked well. Comment using the options below and let’s discuss.