Answered: Can I Use the Attrib Command to Recover Deleted Files?

This post mainly answers the question “Can I use the attrib command to recover deleted files?”. Unfortunately, the answer is NO! Don’t worry, four other options are offered to help get back your deleted files.


By Ellie / Updated on April 2, 2024

Share this: instagram reddit

Can I use the attrib command to recover deleted files?

Many of you may wonder, can I use the attrib command to recover deleted files? Unfortunately, the answer is NO! The attrib command only enables you to recover hidden files. A file might be hidden due to many reasons like system errors, virus attacks, or human causes. If your files disappeared somehow, you could use the attrib command to check whether the file is hidden by unintentional operation or virus infection. For other file loss cases, such as formatting, partition turning RAW, or files being deleted, the attrib command won’t work.

How to use the attrib command to recover hidden files

In this part, we won’t introduce how to recover deleted files using the attrib command as this has been clearly clarified as impossible. Instead, we are going to introduce how to recover hidden files using the attrib command.

Step 1. Plugin your hard drive, memory card, or USB drive into your computer.

Step 2. Open the Windows search box and search for cmd. Locate Command Prompt and choose Run as administrator.

Run as Administrator

Step 3. Type in “attrib -h -r -s /s /d drive letter:\*.*”, for example, “attrib -h -r -s /s /d G:\*.*”.

(Replace G with the drive letter of your hard drive or external storage device where you lost files.)

Attrib CMD

Tips: What do these attrib command parameters mean?
  • -h: It applies the Hidden attribute to the files specified.
  • -r: It denotes the read-only attribute (files can be read but cannot be changed).
  • -s: It assigns the System attribute to the specified files.
  • /s: It instructs the system to look for the specified path (including subfolders).
  • /d: It is made up of process folders.

Step 4. This process will finish after the command prompt returns back the original location. Then you can go to the destination place to check these files. If the attrib command is not working, it may be because is not a hidden document, but a deleted file.

How to recover permanently deleted files using CMD

How can deleted files be recovered when the attrib command is not working? In this section, we'll go over how to recover permanently deleted files using CMD. Specifically, the tool Windows File Recovery will be used.

✍Notes: Windows File Recovery’s outcomes are unpredictable and the tool is only compatible with Windows 10 versions 2004 and up. 

Preparation work before using Windows File Recovery:

 To use this tool, check out your File System first. Go to This PC > right-click on the external drive that contains the deleted files > click Properties.

Check File System SD Card

In addition, you need to use recovery mode and switches to get back your files. To decide which mode to use, refer to this table.

File system Scenarios Mode
NTFS Deleted recently Regular
NTFS Deleted for a while Extensive
NTFS Formatted disk Extensive
NTFS Corrupted disk Extensive
FAT and exFAT Any Extensive

Switches are used to filter the scanning range, thus can save the scanning time.

Switches Meaning Supported mode(s)
/n Filter the scan range: scans for a specific file with its file name/path/type, etc. All
/y: Recover specific extension groups. Signature
/k Recovers system files. NTFSSegment
/u Recovers undeleted files, for example, from the Recycle Bin. NTFSSegment

Step 1. Download and install Window File Recovery on your computer from Microsoft Store and then open it.

Install Windows File Recovery

Step 2. Open Powershell or Command Prompt (run as administrator). In the Command Prompt, enter commands in the following command format:

winfr source-drive: destination-drive: [/mode] [/switches]

For example, if you need to recover deleted pdf files from F: drive (the external hard drive) to D: drive, then the command will be like:

winfr F: D: /regular /n *.pdf

Winfr Regular External Hard Drive Files

Retrieve deleted files when the attrib command isn’t helpful [4 options]

When the attrib command is not helpful, there are actually a number of simpler alternatives to Windows File Recovery for recovering deleted files. Here we offer you four options to recover deleted files.

Option 1. Get back deleted files directly from the Recycle Bin

The first option is to recover deleted files from Recycle Bin.

Step 1. Double-click Recycle Bin on your desktop to open it.

Step 2. Look for the files that you deleted. Right-click it and choose Restore. Your files will then be restored to the location where they were before they were deleted.

Click Restore

Option 2. Restore files using the Backup and Restore utility

The second option to recover data with backup is to use the Backup and Restore utility provided by Microsoft. But you need to make sure that you have enabled this service in advance.

Step 1. Navigate here: Control Panel > System and Security > Backup and Restore (Windows 7). Click on Restore my files to selectively recover permanently deleted files. You can also choose Restore all users’ files to get all deleted files back.

Restore My Files from Windows Backup

Step 2. Search for your PowerPoint files by using the Browse for files or Browse for folders option.

Restore With Windows Backup

Step 3. Choose a location to save the backup, select your files and click Restore to recover them.

Option 3. Use the File History to restore files

If you have turned on File History to save copies of your files, then you can get them back if they are lost/deleted/damaged.

Step 1. Input Control Panel in the Windows search bar, and start it.

Open Control Panel

Step 2. Click System and Security.

System and Security

Step 3. Click File History.

File History

Step 4. Click Restore personal files.

Restore Personal Files

Step 5. Select the files you need to recover and then click the Restore button.

Restore Deleted File

Option 4. Retrieve deleted files via professional data recovery software [recommended]

The final option to retrieve permanently deleted files is to use professional data recovery software, such as MyRecover.

Easy-to-operate. It allows you to recover lost/deleted files from Windows within 3 easy steps.
All-inclusive. It applies to various file loss scenarios in Windows, including recovering files from formatted drives, corrupted partitions, after system crashes, virus attacks, etc.
High-speed. It recovers lost files at high speed. High recovery rate. It recovers your files with a high recovery rate, even if it was permanently deleted.
Widely-compatible. It supports NTFS, FAT32, exFAT, and ReFS in Windows 11/10/8/7 & Windows Server.
Comprehensive. It can recover lost/deleted texts, pictures, videos, audios, emails, compressed files, etc., in original format.

Download, install and launch MyRecover on your computer.  

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

 Step 1. Hover the mouse over the drive and click Scan to scan.

Select partition to scan

Step 2. Then the scanning process will start automatically. You don’t need to wait for the process to complete if you find the PowerPoint files you want to recover.

Scan Lost Data

Step 3. Choose the PowerPoint files that you want to recover. Click Recover xx files and choose a destination path to save the restored PowerPoint files.

Select Deleted PPT Files Click Recover

The Bottom Line

This post has clearly clarified that it is not possible to use the attrib command to recover deleted files. Instead, you are only able to use it to recover hidden files.

If you have accidentally deleted some important files, don’t worry even if you can’t recover them using the attrib command. Five options are presented to you in this post. You can make a decision based on your personal preferences.

Ellie · Editor
Ellie, a professional and experienced writer who is good at solving iOS-related problems and writing iOS backup/transfer tips.