Table of contents

How to Recover Permanently Deleted Files in Windows 11/10/8/7 Using CMD

Updated to Home > HowTos > File Recovery Tips by Robert on Apr 30, 2024 | Approved by Jennifer Allen

Losing important files can be a nightmare, especially if they were permanently deleted. But wait to panic, as there are many ways to get them back, including using the Command Prompt. However, it works in a directive way, which might confuse you. For that, don't worry. Next, we will briefly introduce Command Prompt and provide steps to help you recover permanently deleted files in Windows 10/11 using CMD. At last, provide alternative options for your reference.

What is a Command Prompt on My PC?

Windows PC's Command Prompt (CMD) is a powerful tool that can unleash a new level of control over your system. Despite its intimidating appearance, the possibilities are endless once you get the hang of it. It allows you to interact with your computer through a command-line interface, giving you more direct control over the inner workings of your machine. From moving and copying files to executing scripts and even running system diagnostics and undelete. With the correct commands, you can automate tasks, troubleshoot issues, and access hidden features that are unavailable through a graphical user interface. Even for those who are not tech-savvy, the Command Prompt is worth exploring as it offers a new level of control and customization to your computer experience. If you want to know the command line list, please click here.

Can Delete Files be Recovered by Undelete Command?

Have you ever accidentally deleted a file, only to realize later that you needed it? It's a frustrating feeling. Can it ever be recovered? The answer is yes, it can be. Although it will disappear immediately after we remove a file, the system just clears its information in the boot sector and hides it, and the file itself is still stored in the original sector. Hence, you have a chance to CMD recover deleted files in Windows 10, 11, or 7. However, it's not a guaranteed solution. The success of recovery depends on various factors such as the type of file, the removal method, and how long it has been since deletion. However, it's still worth a try.

How to Recover Deleted Files in Recycle Bin using CMD

Why need to undelete command in dos? Feel powerless after emptying the Recycle Bin? Don’t worry, and The CMD is a great way to get deleted files back from recycle bin or the attrib command to find files. Here are the steps to recover deleted files from recycle bin after empty via command prompt.

  1. Press the Windows key and R at the same time to open the dialogue window.
  2. Type in cmd and press Enter.
  3. At the prompt, type in cd\ and press Enter.
  4. Next, type in cd $Recycle.bin and press Enter. This command may also be "Recycled" or "Recycler" in different operating systems.
  5. Then type in attrib -r -s -h *.* and press Enter.
  6. At last, type in dir */s and Enter. Then you will see all deleted files. In this way, you can quickly recover permanently deleted files using command prompt in Windows 10/11/7.

After then, you can see there is a list of items like Dc25.url, Dc26. Ink, etc. Actually, the number represents the number of deleted files. "D" means the drive where the Windows operating system is installed. A hidden folder is creating on each volume that has the recycle bin enabled named Recycled. Any deleted files are moved to this folder and renamed to C <original drive letter> <number file deleted> <original extension>. The original full name and path are stored in a mapping file Info.

Use the COPY command to get back the files you need. For example, COPY *.DOC C:\Temp to copy all DOC files to C:\Temp. Now you can open these data and find the one(s) that you wanted to CMD recover deleted files.

How to Recover Permanently Deleted Files using Command Prompt

Windows undelete command can get data back from an internal or external drive? Especially for external devices such as USB flash drives, pen drives, or SD cards, even if you only click the Del key, the removed items will still not be put into the recycle bin. Of course, you can still CMD undelete, but the command is different. The following are the detailed steps to recover deleted files using CMD:

  1. Hit the Start button at the bottom left of the screen and type CMD.
  2. Find Command Prompt and click Run as administrator to open it.
  3. Type chkdsk E:/f and press Enter(the "E" is your drive letter). If the file for this volume is used, close it or type Y to force it to be uninstalled.
  4. Type in attrib -h -r -s /s /d E:*.* and press Enter. This way will help you recover files using CMD.

Note: Your deleted files will be saved to your E drive in a newly created folder. You must change the file extensions to a normal format to make them reusable.

Best 6 Alternative Solution to Undelete Files Using CMD

CMD recover deleted files is a little complicated. To use undelete command, you must know the primary command line languages. A professional undelete tool is an excellent option if you prefer an easier way to get lost items. Here, we provide the six best alternatives for your reference.

  1. iBeesoft Data Recovery
  2. iBeesoft Data Recovery is an innovative and powerful software solution that helps you recover permanently deleted files in Windows 11, 10, 7, and Mac. You can regain lost data within minutes with an intuitive user interface and a step-by-step wizard. It also comes with advanced deep scan techniques that ensure you will get all minute details during the scanning process to ensure full recovery of your items.

    Your Safe & Effective File Recovery Tool

    (Trust Score 4.7 by 1695 Users)
    • The best program to recover deleted files or formatted drive recovery can also automatically organize damaged and fragmented items.
    • Supports over 1000 file types, including pictures, videos, audio files, archieves, Word doc, Excel worksheet, PDF files,and more.
    • It can recover files from recycle bin after emptying, formatting the drive, after 'Shift + Del', virus infection, accidentally deleted partitions, etc.
    Download for Windows Download for macOS
  3. EaseUS Data Recovery Wizard
  4. EaseUS Data Recovery is a reliable data recovery solution for Windows PC users. The advanced scan mode increases accuracy and the chance of recovery by searching further into the system after a quick scan finish. It supports undelete on all devices, including PCs, laptops, digital cameras, USB flash drives, and memory cards. With this alternative to recover permanently deleted files in Windows 10/11 using CMD, you no longer have to worry about lost data.

    Provide two modes to retrieve deleted items
    You can preview the found files before recovery
    Need to pay up to $69.95 per month
    Sometimes, the recovered files cannot be read normally
  5. Recoverit
  6. Recoverit is an efficient solution that can quickly and rapidly retrieve the files they have lost due to accidental formatting, hard drive corruption, virus attacks, or any other unexpected mishaps. The software supports all major file systems, such as FAT16/32, NTFS, EXT2/3, HFS+, and even APFS, meaning that works with almost all storage media. Whether it's some precious pictures of a loved one or important documents from work that were accidentally deleted, This undelete command alternative solution has got you covered!

    Recoverable disk image
    Fast scanning speed
    Unable to fully extract data from the recycle bin
    Only specific files can be previewed
  7. Puran Recovery
  8. Puran File Recovery is an excellent tool for recovering deleted files on Windows-based PCs. It's designed conveniently, quickly, and accurately, making the recovery process fast, easy, and stress-free. The software can deep scan entire hard drives in minutes to recover files even after emptying them from the Recycle Bin. With its intuitive interface and advanced scanning algorithm, this program is ideal as a CMD recover deleted files alternative.

    Can run in the BartPE environment
    Support up to 50 file formats
    Simple file filtering
    Not friendly enough for recovering SSD drives
  9. Recuva
  10. Recuva uses advanced algorithms to locate every bit of missing data and provide reliable results in no time. It can easily recover nearly all common file types, from documents to photos, videos, compressed archives, etc. And best of all, it comes with an easy-to-use user interface that makes it simple to get started without any technical knowledge required.

    Wizard mode is easy to use
    Display the status of recoverable files
    The basic version has functional limitations
    No file filtering options
  11. SoftPerfect File Recovery
  12. SoftPerfect File Recovery is a lightweight app for recovering deleted files in Windows 10, 11, and 7. The intuitive software uses advanced algorithms to locate every bit of missing data and provide reliable results in no time. It can automatically switch the search mode; a quick scan mode which finds recently deleted files in seconds, or a full scan mode which searches for all lost files on your device.

    Filter file types before scanning to save scanning time
    Provide a portable version
    Can't preview the file you are looking for
    NNo extra useful options

Using the command prompt to recover deleted files in Windows 7/10/11 requires at least some computer knowledge. So, for familiar people, I recommend using the alternative solutions above. They all have a simple user interface to help you faster.

How to Prevent Important Files from Being Accidentally Deleted

Accidentally hitting delete on a file that you desperately needed. It's frustrating, time-consuming, and potentially leading to losing important information. To this end, you can adopt the following methods to prevent this.

By implementing these simple precautions, you can protect your valuable files from accidental deletion.

Frequently Asked Questions

  • If the new data is not saved after removing the file, you can use the undelete command to retrieve it. To do this, you can type undelete [d:][path][filename] [/DT|/DS|/DOS].

  • You need to run it as administrator and enter attrib -h -r -s /s /d X:*.* (X) is the drive letter of the lost data. But it may not work. For this, you can also try easier and more effective file recovery software.

  • Of course, you can, as long as you don't store new files repeatedly. Usually, you can recover permanently deleted files using CMD or data recovery software.

  • In general, you can click F7 to view the history.

  • First, you can try to recover permanently deleted files in Windows 10 using CMD. Second, you can also use a professional tool - iBeesoft Data Recovery.

  • Yes only if the files are not permanently deleted. The mainly used ways are restoring deleted files from recycle bin, restoring files from File History, restoring files from the software AutoSave, etc. However, the data recovery success rate is not as high as using software.

  • Yes, there is free data recovery software for Windows 11, 10, and 7 to get deleted files back. You can get some from the internet. However, most of them has limited features for data recovery, like file size limitation or file type limitation. iBeesoft Free Data Recovery is the one that offer you the most and best features for data recovery in Windows by supporting 1000 file types, 2000 devices, 500+file loss scenarios, and let you recover up to 2GB files for free.

  • While do the undelete command prompt, the existing data on the hard drive might be replaced or overwritten, which will cause data loss issue. And what’s more, the undelete command prompt will not point any specific files to recover. It might cause unwanted files to restore and causing data disorder.


Accidentally deleting important files is a frustrating and all too common experience for computer users. Luckily, this article can guide how to recover permanently deleted files using command prompt in Windows 11/10/7. Also, we have provided alternatives and hope they will help you.