What Is Attrib Command Windows 10/11?
Read-only You may not change or delete the specified read-only file.
Archived It provides a backup of the file to help recover the file when it is corrupted or missing.

System Mark the file as an important file hence changing its priority.
Do you know what the difference between data archiving and backup is?
See this guide to get the answer:Whats Data Archiving & Whats Difference Between It and Backup.

+h: make the file attributes as hidden and not visible to the user.
-h: scrub the hidden file attribute.
+r: set the read-only attribute to the file or directory.

-r: reset the read-only attribute.
+a: set the archive file attribute to the file or directory.
-a: wipe the archive attribute.
![]()
+s: set the file attribute as a system file.
-s: dump the system file attribute.
/s: process files in all directories in the specified path.
![]()
/d: 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.
If you dont add double-quotes, you will receive a Parameter format not correct warning pop-up.

How to Use Attrib Command to Hide or Unhide Folder?
As mentioned above, some attribute commands can hide folders and files, lets see how it works.
Preparation
Before doing that, you gotta know the actual folder path of the desired file/folder.

Method 1: Hidden Folders via Command Prompt
Step 1.
After getting the folder path, typecmdin thesearch barto locateCommand Prompt.
Right-click it to chooseRun as administrator.
Step 3. key in the following command and hitEnter.
Dont forget to changeD:\MiniTool ShadowMaker\datainto your target folder path.
attrib +s + h D:\MiniTool ShadowMaker\data
Step 4.
Heres how to do it:
Step 1.
OpenFile Explorerand locate the file or folder you would like to hide.
For Windows 10, pressShiftand do a right-click inFile Explorerand chooseOpen PowerShell window herein the context menu.
For Windows 11, selectOpen in Windows Terminal.
Step 3. throw in the following command and hitEnter.
Also, remember to replace theFolder_Namewith your actual folder name.
To make a distinction between them, see this guide -PowerShell vs CMD: What Are They?
What Are Their Differences.
How to Use Attrib Command to Recover Hidden Files?
In this case, you’re free to find the hidden files with attrib command.
To do so, you need:
Step 1.
RunCommand Promptas an administrator.
Step 2. jot down the following command and hitEnter.
attrib -h -r -s /s /d g:*.
Typedirand hitEnter, you will see all the files under the assigned drive.
The virus name may contain words likeautorunwith.infas extension.
you’ve got the option to typedel autorun.infand hitEnterto remove them.
*command again to see whether the deleted files still exist or not.
Learn what DIR command is and how to use DIR command in Windows 10/8/7.
DIR command switches and options are included.
Do you know what attrib command is now?
How to use it to hide or unhide files?
If you cannot find the files after running theattrib -h -r -s /s /d g:*.
Double-go for the shortcut ofRecycle Binon your desktop.
Look for the file you want to recover.
Right-click it, chooseRestoreand then the file will be restored to its original location.
What if your Recycle Bin is corrupted?
Recover Data & Fix It.
you could 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.
MiniTool Power Data Recovery TrialClick to Download100%Clean & Safe
Step 2.
Move the cursor on the drive where your file is supposed to be and hit theScanbutton.
After the scanning is complete, you might see all the files that this product can find.
initiate the folders one by one to find the file you want to recover.
Step 4. choose the file you need and hit theSavebutton to choose a suitable location to store it.
Now, follow the instructions below to create an automatic file backup with us.
Download and install MiniTool ShadowMaker Trial.
MiniTool ShadowMaker TrialClick to Download100%Clean & Safe
Step 2.
After a successful installation, launch it and pressKeep Trial.
Go to theBackupfunctional interface and you could see theSourcebutton on the left and theDestinationbutton on the right.
PressSource>Folders and Filesand then you might grab the files or folders that are important to you.
PressDestinationand you’re able to choose a storage path for your files.
HitScheduleat the lower right of theBackupfunctional interface and turn on this feature manually.
Click onBack up Nowto start the file backup task at once and your task will be finished quickly.
Go to this guide for more details -How to Backup Files on Windows 10?
Try These Top 4 Ways.
We also provide you with some workable fixed and suggestions to get your files back and avoid file loss.
A million thanks to you!