Recently, I've shown you how to lock folder with a password using a simple trick and built-in tools. In this quick tutorial, let me show you how to super hide a folder using attrib command. When I say super hide what I actually mean that even if you try to unhide the folder using the usual means, it will not appear in the File Explorer. You can achieve this using the Windows attrib command. Let me show you how.
Note: The below trick works with older systems like Windows 7 and Windows 8 too.
Method #1 - Hide Folders with Attrib CMD in Command Prompt
To hide a folder with the attrib command, we are going to use the Command Prompt. Before doing that, you need to know the actual folder path.
1. The easiest way to copy folder path is via the File Explorer. So, open the File Explorer and go to the folder you want to hide and open it. Next, click on the address bar and you will see the folder path. To copy the path, right-click and select "Copy" option.
2. Once you have the folder path, open the command prompt window by searching for it in the start menu.
3. Now, execute the below command to hide the folder. Don't forget to replace the dummy folder path with the actual folder you copied earlier. To paste the copied folder path, simply right-click in the command prompt. Alternatively, you can also right-click on the title bar and select "Edit -> Paste" option.
attrib +s + h "C:\folder\path\"
4. As soon as you execute the command, the folder will be hidden from the plain sight.
5. Even if you try to unhide the folder by selecting "Hidden files" checkbox in the View tab, you can't see the folder hidden using the attrib command.
6. To unhide the folder, you can use the same attrib command with a slight modification. All you have to do is replace "+" in the above command with "-". Simply put, use the below attrib command to unhide folder.
attrib -s -h "C:\folder\path\"
7. Upon successful execution, the folder will reappear in the file explorer.
As you can see, it is nothing hard and the attrib command is quite useful to quickly hide any folder you want.
Method #2 - Attrib CMD to Hide Folders With PowerShell
Since Windows 10 is furiously promoting PowerShell over the command prompt and considering how PowerShell supports almost all the command prompt commands, you can also use the same exact technique to hide folders in Windows 10. Let me show you how.
1. First, open the file explorer and go to the place where you've stored the folder you want to hide. For instance, my folder "WindowsLoop" is located in the root of the D drive. So, I opened the D drive and as you can see, I have a folder named "WindowsLoop" in the root.
2. Now, Shift + Right-click in the file explorer and select "Open PowerShell here" option. This action will open the PowerShell in the same folder. This makes it so that you can use just the folder name rather than the full folder path in the PowerShell command.
3. In the PowerShell window, execute the below command. Don't forget to replace Folder_Name with the actual folder name. If the folder name has space(s) in it, wrap it in quotes just like the below command.
attrib +s +h "Folder_Name"
4. To unhide the folder, you can use this command.
attrib -s -h "Folder_Name"
So, How Does the Attrib Command Hides the Folder?
There is no magic here. All we are doing is changing the folder attributes in such a way that Windows thinks of it as a protected system folder. Protect system folder are hidden by default. You see, when you use the unhide option in the View tab, Windows won't show the protected system folder. To see a protected system folder, you need to specifically tell Windows to show it. If you are curious, follow the below steps after hiding the folder using the above method to see the hidden protected system folder.
1. First, unhide the folder by selecting the checkbox "Hidden items" under the View tab. Without doing this step first, you will not see the hidden protected system folder even if you follow the other two steps below.
2. Next, click on the "Options" button in the same View tab.
3. This action will open the Folder Options window. Here, go to the "View" tab and uncheck the "Hide protected operating system files (Recommended)" option and save changes by click on the "Ok" button.
That is it. You should instantly see the hidden folder along with some other protected system folders like $Recycke.BIN, System Volume Information, etc. To reverse the change, select the "Hide protected operating system files (Recommended)" checkbox in step 3.
Attrib Command to Hide Folder - Conclusion
As you can see attrib is a pretty nifty command to quickly super hide folders from plain sight so that it won't appear even if someone selects the "Hidden Items" option the View tab. Unless a user knows how to see the protected system files or knows the exact folder path, you can be pretty sure that no one will ever see your hidden folder. That being said, this is a poor and unsafe way to store/protect personal and sensitive information. You should be using proper tools like BitLocker or VeraCrypt to protect your sensitive information.
If you like this article, do check out how to delete files with commands and how to format a USB drive with commands, and how to zoom in and zoom out in command prompt and PowerShell.