Recover Permanently Deleted Files Windows 10 Using CMD

Losing important files can be a frustrating experience, especially when they are permanently deleted from your Windows 10 system. Fortunately, there are ways to recover these files without the need for third-party tools. One effective method is to use Command Prompt (CMD) to recover permanently deleted files. In this article, we’ll walk you through several techniques using CMD that can help you restore lost files, whether they were deleted accidentally or lost due to system issues. Learn how to recover permanently deleted files Windows 10 using CMD with simple step-by-step instructions.
File Deletion in Windows 10: What Happens & How to Recover Files.

1. What Happens When You Delete a File?
- Recycle Bin Storage – Deleted files first move to the Recycle Bin and can be easily restored.
- Permanent Deletion (Shift + Delete) – Files bypass the Recycle Bin and become harder to recover.
- Overwriting Risk – Deleted files remain on disk until new data replaces them.
2. How to Recover Deleted Files?
- Restore from Recycle Bin (if not emptied).
- Use File History or Backup (if enabled).
- Recover with CMD Tools (Attrib, CHKDSK, Winfr).
- Try Data Recovery Software for deep scans.
Using CMD to Recover Permanently Deleted Files
1. Restore from File History via CMD
File History helps recover permanently deleted files Windows 10 using CMD if backups were enabled. Follow these steps:
Step 1: Open Command Prompt (CMD) as administrator.
Step 2: Type fhmanagew.exe -restore <Drive>:
and press Enter.
Step 3: Browse available backups and locate the deleted file.Select the file and click Restore to recover it.
Step 4: If File History was disabled, try other CMD methods like Attrib or Windows File Recovery.
2. Recover Files Using Windows Built-in ATTRIB Command
What Is the ATTRIB Command?
The attrib
command in Windows Command Prompt helps reveal hidden, lost, or system-protected files. Sometimes, deleted files become hidden rather than permanently erased. By using attrib
, you can restore access to such files.
Steps to Recover Deleted Files Using ATTRIB Command
Step 1: Open Command Prompt (CMD) as administrator.
Step 2: Type: attrib -h -r -s /s /d X:\*.*
(Replace X: with your drive letter).

Step 3: Press Enter to execute the command.
Step 4: Check the drive for recovered files.
If this method doesn’t work, try Windows File Recovery (winfr) for deeper recovery.
3. Using CHKDSK to Fix Corrupted File System and Restore Files
What Does CHKDSK Do?
CHKDSK (Check Disk) scans and repairs disk errors, bad sectors, and file system corruption. While it doesn’t directly recover deleted files, it can restore access to lost data by fixing disk issues that may prevent file retrieval.
Steps to Run CHKDSK via CMD for File Recovery
Step 1: Open Command Prompt (CMD) as administrator.
Step 2: Type: chkdsk X: /f /r /x
(Replace X: with your drive letter).

Step 3: Press Enter and wait for the scan to complete.
Step 4: Restart your PC and check if lost files are accessible.
4. Using Windows File Recovery (winfr) via CMD
Windows File Recovery (Winfr) is a command-line tool by Microsoft that helps recover permanently deleted files on Windows 10. It supports recovering files from local drives, including NTFS, FAT, exFAT, and ReFS file systems.

1. How to Install Windows File Recovery
- Open Microsoft Store and search for Windows File Recovery.
- Click Get to install the tool.
- Once installed, open Command Prompt (CMD) as administrator.
2. How to Use Winfr – Syntax & Examples
Winfr supports two primary recovery modes:
- Regular Mode (for recently deleted files on NTFS drives)
winfr C: D: /n \Users\YourName\Documents\*.docx
(Recovers .docx files from C: and saves them to D:)
- Extensive Mode (for formatted or corrupted drives)
winfr C: D: /x /y:JPEG,PDF
(Recovers JPEG and PDF files from C: and saves them to D:)
Limitations of CMD for File Recovery
1. Cases Where CMD Methods May Not Work
- File History is Disabled – If File History wasn’t set up, recovery via CMD won’t work.
- ATTRIB Command Limitations – It can only reveal hidden files, not recover permanently deleted ones.
- CHKDSK Repairs but Doesn’t Recover – It fixes disk errors but doesn’t restore deleted files.
- Windows File Recovery (Winfr) Restrictions – It may fail on severely corrupted or overwritten files.
2. The Risk of Data Being Overwritten
When a file is deleted, Windows marks its space as available. If new data is saved, it may overwrite the deleted file, making recovery impossible. To improve success rates:
- Stop using the affected drive immediately.
- Avoid installing recovery software on the same drive.
- Use CMD recovery methods as soon as possible.
Alternative Solutions for Better Recovery Results
While CMD offers built-in recovery methods, third-party tools like WinfrGUI provide a more user-friendly, efficient, and reliable approach to recovering permanently deleted files. These tools often come with graphical interfaces that simplify the recovery process, offering advanced features such as deeper scans, easier file previews, and more file type support.
Professional recovery software should be used in the following situations:
- CMD Methods Fail – If built-in tools like CMD (ATTRIB, CHKDSK, Winfr) don’t recover your files, third-party software can offer deeper scanning and better recovery options.
- Severe File Corruption – When files are corrupted or the file system is damaged, professional tools can repair the structure and retrieve lost data.
- Accidental Formatting – After accidentally formatting a drive, professional software can help recover lost files from formatted partitions.
- Overwritten Data – If data is partially overwritten, advanced tools can recover fragments and pieces of the file.
- Large Data Recovery – For larger data sets, professional tools offer faster and more reliable recovery, supporting different file types and recovery scenarios.
How to Prevent Important Files from Being Accidentally Deleted
Using CMD to recover deleted files in Windows can be complicated for some users. Therefore, it is recommended to consider these alternative solutions, which offer a simple user interface to help you recover your files faster.
To prevent important files from being mistakenly deleted, you can use the following methods:
- Enables the file history function on your Windows computer to create a backup of your files. This ensures that even if you accidentally delete something, you will receive a back-up copy.
- Create a backup of the necessary files on an external hard drive or cloud storage. This provides an additional layer of protection and ensures that you can still access your files after accidentally deleted.
- Restrict access to important files by setting password protection. This can prevent deletion by unauthorized users.
- Always double-check before pressing the delete button. Take a while to check what you’re deleting to avoid unintentional deletion.
- By following these simple precautions, you can protect your valuable files from unintentional deletion.
Conclusion
Recovering permanently deleted files from Windows 10 using CMD is a feasible solution for many users, particularly when built-in recovery tools like File History or CHKDSK are unavailable. While CMD offers methods such as using the ATTRIB command, CHKDSK, or Windows File Recovery, it’s important to act quickly before the data gets overwritten. However, if CMD methods don’t yield the desired results, professional data recovery tools may offer more advanced options. Remember, regular backups and using tools like File History can prevent data loss in the future.
>>Also Read: Is There A Way To Get Permanently Deleted Photos Back on Windows?