Attrib command is very helpful for hiding or unhiding a folder completely and it can provide security benefits to your important files & software programs. In this article on
, we will discuss how to make your files and folders visible and invisible with attrib command and what you should do when attrib command not working happens step by step. Scroll down to get more details!
What Is Attrib Command Windows 10/11?
The attrib command is a command prompt whose main purpose is to delete and set file attributes like read-only, hidden, system and archive. Attrib command can run from the
in all versions of Windows and it offers security to your software programs and important documents.
There are 4 conventional attributes in files and folders in Microsoft Windows:
- It makes the files and folders invisible. Therefore, if others use your device, these files and folders will be safe because they cannot see and access the files.
– You may not change or delete the specified read-only file.
– It provides a backup of the file to help recover the file when it is corrupted or missing.
– Mark the file as an important file hence changing its priority.
In this part, we will show you the most common attrib command parameters:
: run this command alone to see the attributes set on the files within the directory that you execute the command form.
: make the file attributes as hidden and not visible to the user.
: clear the hidden file attribute.
: set the read-only attribute to the file or directory.
: clear the read-only attribute.
: set the archive file attribute to the file or directory.
: clear the archive attribute.
: set the file attribute as a system file.
: clear the system file attribute.
: process files in all directories in the specified path.
: only used with /s and it includes directories, not only files, to whatever you executing.
: for all the files with all different types of file extensions.
Like all the commands in
, you should use double-quotes around a folder or file name that has spaces. If you don’t add double-quotes, you will receive a “
Parameter format not correct
” error message.
How to Use Attrib Command to Hide or Unhide Folder?
As mentioned above, some attribute commands can hide folders and files, let’s see how it works.
Before doing that, you need to know the actual folder path of the desired file/folder. Go to
> find the folder/file you want to hide > copy the folder/file path on the address bar.
Method 1: Hidden Folders via Command Prompt
Step 1. After getting the folder path, type
Step 2. Right-click it to choose
Run as administrator
Step 3. Type the following command and hit
. Don’t forget to change
into your target folder path.
attrib +s + h "D:\MiniTool ShadowMaker\data"
Step 4. After the command is executed successfully, the folder will become invisible even when you check the
option in the
If you want to unhide this folder, you can run the command below:
attrib -s -h "D:\MiniTool ShadowMaker\data"
After the execution, the folder will appear in
Method 2: Hidden Folders via Windows PowerShell
You can use the same technique to hide folders in Windows 10/11 PowerShell because it supports almost all the CMD commands. Here’s how to do it:
Step 1. Open
and locate the file or folder you would like to hide.
Step 2. For Windows 10, press
and do a right-click in
Open PowerShell window here
in the context menu. For Windows 11, select
Open in Windows Terminal
. Now, you can just use the folder name rather than the full folder path in Windows PowerShell command.
Step 3. Type the following command and hit
. Also, remember to replace the
with your actual folder name.
attrib +s +h "Folder_Name"
If you want to unhide the folder, run this command below:
As mentioned above, you can use attrib command to check whether the file is hidden by virus infection or other reasons. If you cannot find the files after running the
attrib -h -r -s /s /d g:\*.*
command for the first time, chances are that the files are not hidden ones but deleted or missing due to formatting, partition turning RAW and more.
Fix 2: Recover the Deleted Files via MiniTool Power Data Recovery
If you cannot find the desired file in Recycle Bin, you can try MiniTool Power Data Recovery, the
professional data recovery software
to recover it from your computer. This product is designed to help you to recover deleted, lost or formatted files on different types of data storage devices like an internal/external hard drive, SSD, USB flash drive, SD card, pen drive and more. You can restore your file in just a few clicks with this tool. To do so:
Step 1. Download, install, and launch MiniTool Power Data Recovery Trial.
Step 2. Move the cursor on the drive where your file is supposed to be and hit the
If you forget the original location of the lost or deleted file, you can go to the
tab to select the whole disk to scan.
Step 3. After the scanning is complete, you can see all the files that this product can find. Open the folders one by one to find the file you want to recover.
To recover your file, you need to go to MiniTool official website to get a license key and use it to register MiniTool Power Data Recovery in the scan results interface.
Step 4. Select the file you need and hit the
button to choose a suitable location to store it.
Suggestion: Back up Your Precious Files to Avoid Data Loss
File loss must be a frustrating experience. If you don’t want to suffer from it again, you can take some preventative measures such as creating a regular backup. As for backing up files, it is highly recommended to try MiniTool ShadowMaker, the
free and reliable backup software
. This backup tool enables you to create a daily, weekly, monthly or on-event backup for files/folders, drives, systems and partitions. Now, follow the instructions below to create an automatic file backup with us.
Step 1. Download and install MiniTool ShadowMaker Trial.
Step 2. After a successful installation, launch it and press
Step 3. Go to the
functional interface and you can see the
button on the left and the
button on the right.
Step 4. Press
Folders and Files
and then you can select the files or folders that are important to you.
Step 5. Press
and you can choose a storage path for your files.
Step 6. Hit
at the lower right of the
functional interface and turn on this feature manually. Then, you can set some particular time points to execute the scheduled backup each day, week, month or on event.
Step 7. Click on
Back up Now
to start the file backup task at once and your task will be finished quickly.
This post provides you with a detailed description of the definition and parameters of attrib command and how to use it to hide or unhide files. At the same time, there are some special cases in which attrib command is not working because your file is deleted, lost or corrupted.
We also provide you with some workable fixed and suggestions to get your files back and avoid file loss. If you are curious about attrib command and our products, welcome to share your ideas with us in the comment area below or send an email via
. A million thanks to you!
Aurelie is a passionate soul who always enjoys researching & writing articles and solutions to help others. Her posts mainly cover topics related to games, data backup & recovery, file sync and so on. Apart from writing, her primary interests include reading novels and poems, travelling and listening to country music.