Hide and Unhide a Folder Using CMD in Windows
Using the attrib command in Command Prompt
In Windows, we can hide or unhide a folder using the Command Prompt (CMD) with the help of the attrib command. This method is simple and does not require any third-party software.
1. What is attrib Command?
The attrib command is used to display, set, or remove file and folder attributes.
Some important attributes:
-
+h→ Hide the file/folder -
-h→ Unhide the file/folder -
+s→ System file -
-s→ Remove system attribute
2. Steps to Hide a Folder Using CMD
Step 1: Open Command Prompt
-
Press Windows + R
-
Type
cmd -
Press Enter
Or search Command Prompt in the Start menu.
Step 2: Go to the Folder Location
Use cd command to navigate.
Example:
If your folder is inside another folder:
Step 3: Hide the Folder
Use this command:
Example:
Now the folder Secret will be hidden.
If you want stronger hiding (system + hidden):
3. How to Unhide the Folder Using CMD
To make the folder visible again:
Example:
If you used system attribute also:
Now the folder will be visible again.
4. Important Notes
-
Hidden folders can still be seen if:
-
"Show hidden files" is enabled in File Explorer.
-
-
This method is not password protection.
-
It is only basic privacy, not strong security.
5. Advanced (Hide All Files Inside Folder)
To hide folder and all files inside it:
To unhide everything:
Where:
-
/s→ Applies to all files in subfolders -
/d→ Applies to folders also
0 Comments