Attrib Command Not Working? Fixed!

Figure out reasons of attrib command not working in this passage. Besides, you can also learn more about Windows data recovery software.


By Penny / Updated on May 23, 2022

Share this: instagram reddit

What is the attrib command?

ATTRIB is a Microsoft Windows command that displays or changes the file attribute of a file or folder. To be more precise, the attrib command allows users to modify and set file attributes read-only, hidden, system, and archive. And it’s run from the Command Prompt in all versions of Windows.

For example, in early versions of Windows, a temporary file only can be read and was also locked (and irrevocably) by Windows OS. In this case, there’s no better way to delete this file than by booting into DOS (avoiding the Windows lock) and modifying the read-only attribute with ATTRIB.


New versions of Windows have also seen the extension of the inventory of available attributes on the NTFS file system. Here, you’re supposed to be familiar with these four conventional attributes in Microsoft Windows, files, and folders.

Read-only (R): Users have no written permission to alter or change the read-only file.

Hidden (H): MS-DOS commands like dir and Windows apps like File Explorer will not show hidden files by default, making files or folders invisible to users.

System (S): Mark the file as an important file system, and change the priority of the file.

Archive (A): The hosting file has been changed since the last backup. Then backup software will inevitably clear it after making a full/incremental backup.

Why is the attrib command not working?

Now that we’ve figured out the definition of attrib command and its common functions, let’s tap into the reasons for the attrib command not working. As stated earlier, one of the most exciting functions of ATTRIB is to show hidden files using the command prompt within easy-to-follow steps.

Perhaps some users do not share this opinion. They might prefer recovering the deleted files using the Archive feature of the attrib command. However, the facts proved that many users are more inclined to backup software to retrieve the deleted documents because there’s a graphical user interface.

Why attrib command not working? The reason is that the file is not a hidden document, but a deleted document. So you’d better tweak your thoughts, and take Windows data recovery software into account to recover the deleted files.

How to recover files using Windows data recovery software?

If you’re in this part, which means you’ve realized your files were deleted instead of hiding. Meanwhile, there’re two types of Windows data recovery software for you to select. In brief, computer-savvy users can use Windows File Recovery. On the contrary, you can utilize MyRecover directly.

Case A. Windows File Recovery

Released in 2020, Windows File Recovery is a command-line program to recover lost files. That means this software uses cmd.exe (CMD/command prompt) to interact with users through a command-line interface rather than a graphical user interface. Thus, you should enter varied command lines for corresponding file systems and modes.

You can recover deleted Word/PPT/Excel/ZIP/PDF/PNG/MPEG/MP3/JPEG files from your HDD/USB/memory card/SD card using this powerful utility. Pay attention that recovery on cloud storage and network file share is disabled.

If you’ve found your files were gone, please stop using your PC and don’t add new data to it because any use of the computer could lead to overwriting the free space.  

Select “Yes” when prompted to allow the app to make changes to your device.   
Two basic modes (Regular/Extensive) & two advanced modes (Segment/Signature) can support NTFS/FAT/ex-FAT/ReFS file systems.
Ensure your source drive (locate where were your deleted files before deletion) is different from your destination drive (where to save your recovered files).
 Modify winfr source-drive: destination-drive: [/mode] [/switches] and input the adjusted command lines in the Command Prompt window.
 Figure out your file system within these steps. Click “This PC”, and right-click on the source drive, then click “Properties”.


Step 1. Download Windows File Recovery from the Microsoft Store by clicking the “Get” button, then install it on your computer.


Step 2. Enter “Windows File Recovery” in the search bar. Then select “Run as administrator” to run it.


Step 3. You can select a comprehensive mode after figuring out your file system.

File system


Recommended mode


Deleted recently



Deleted a while ago



After formatting a disk



A corrupted disk


FAT and exFAT



Step 4. Adjust and resemble command lines with some common switches below.



Supported mode(s)


Filter the scan range: scans for a specific file with its file name/path/type, etc.



Recover specific extension groups.



Recovers system files.

NTFS Segment​​​​​


Recovers undeleted files, for example, from the Recycle Bin.

NTFS Segment

Step 5. For instance, if you plan to recover your PDF files from the C drive and save these files on the E drive, you can input command lines like this: winfr C: E: /regular /n *.pdf

Step 6. Press “y” to continue and wait patiently. You can also press the “Ctrl + C” keys to stop this process.

Case B. MyRecover

If you come errors using Windows File Recovery, you can discontinue using it and switch to this user-friendly application because it’s compatible with Windows 7/8/10/11.

MyRecover also renders an accessible graphical user interface. This handy program can help you to recover deleted files such as Microsoft Office /Photos/Videos/Audios/Emails/ZIP files from HDD/SSD/USB within simple clicks. It even enables you to recover the corrupted/formatted files. Let’s perform how it works.  

Step 1. Download and install MyRecover on your computer.

Download SoftwareWin 11/10/8/7/Server
Secure Download

Step 2. Specify a partition that includes your needed files, and click “Start Scan”.


Step 3. This tool will perform Quick Scan or Deep Scan automatically. After scanning, your deleted files and other lost files will be shown on the screen respectively.


Step 4. Specify another destination partition or folder to save your recovered files and click  “Recover x files” to recover the files you want to retrieve. 


 After that, go to your destination place to check your recovered files.

Bonus tip: How to avoid data loss efficiently?

This tutorial helps you clarify the definition of ATTRIB and its reasons for the attrib command not working. Maybe you have a clearer understanding of hidden files now. If your files indeed are hidden documents, you can use the attrib command to reappear.

If you fail to show hidden files using CMD, you can try other Windows data recovery software like MyRecover to confirm your guesses.

If you’ve already experienced the agony of data loss and don’t want to go through it again. You’d better create regular backups using freeware AOMEI Backupper to make an automatic/full/incremental/differential backup in terms of files/partitions/system files.

Penny · Editor
Penny works as an editor at AOMEI Technology, while she's a tester and editor for AOMEI Data Recovery Tools. She enjoys helping users with data recovery issues on Windows and iPhones using simple and practical solutions. Outside of work, she has a strong affection for pets, particularly giant pandas.