With technology advancing rapidly, data privacy has become more important than ever. Many users rely on different methods to keep sensitive information secure, and on Windows, one simple yet effective approach is hiding files and folders using Command Prompt.
In this guide, we’ll explain how to hide and unhide files and folders on Windows using Command Prompt, in a clear and beginner-friendly way.
How to Hide Files and Folders Using Command Prompt
Windows is one of the most widely used operating systems for desktops and laptops. However, many users are still unaware of the powerful tools it offers, including Command Prompt.
Command Prompt is a built-in command-line interpreter in Windows. While it may look intimidating at first, it can perform several useful tasks, such as hiding and unhiding files and folders, without installing any third-party software.
Follow the steps below to hide files or folders on your Windows PC.
1. Go to the taskbar, search for Command Prompt, and click on the result to open it.

2. Navigate to the location of the file or folder you want to hide by typing the cd command and pressing Enter:
cd C:\Users\admin\Desktop\Files
Note
Replace the path after cd with the actual location of the file or folder you want to hide.
3. To hide a file or folder, type the following command and press Enter:
attrib +h "Secret Files"

Replace “Secret Files” with the name of the file or folder you want to hide. Quotation marks are only required if the name contains spaces.
However, if you don’t know the file or folder name, you can use the dir command to view them.
Once the command is executed successfully, the selected file or folder will no longer be visible in File Explorer.
How to Hide All Files and Subfolders Inside a Folder
If you want to hide an entire folder along with everything inside it, follow these steps:
1. Open Command Prompt and navigate inside the folder by typing the cd command.
2. To hide all files and subfolders within that folder, type the following command and press Enter:
attrib +h /s /d

Command Prompt will process all files and folders inside the directory. After completion, all items inside the folder will be hidden from File Explorer.
How to Unhide Files and Folders Using Command Prompt
You can remove the hidden attribute at any time by following these steps.
1. Open Command Prompt from the taskbar search.
2. Navigate to the location of the hidden file or folder using cd command:
cd C:\Users\admin\Desktop\Files
Note
Update the path according to your file location.
3. Type the following command to unhide a file or folder and press Enter:
attrib -h "Secret Files"

The file or folder will become visible again in File Explorer.
How to Unhide All Files and Subfolders Inside a Folder
If you previously hid all files and subfolders within a folder, follow these steps to unhide them:
1. Open Command Prompt and move into the hidden folder loaction using cd command.
2. Remove the hidden attribute from all files and subfolders by typing:
attrib -h /s /d

3. Wait for the command to finish processing. After that, all files and subfolders inside the folder will now be visible.
Final Thoughts
Using Command Prompt to hide or unhide files and folders on Windows is much simpler than it appears. Once you get comfortable with a few basic commands, it becomes a fast and efficient way to manage file visibility.
Just make sure you remember the file name and location before hiding anything. Otherwise, you may need to to locate it later.
