> How to > Storage Media Recovery > How to Recover Deleted Files from Memory Card Using CMD

How to Recover Deleted Files from Memory Card Using CMD

Updated on Dec 28, 2018 by Jean to Storage Media Recovery


The command to recover deleted files from memory card, USB stick, pen drive and external HDD includes the attrib command and the dos command. This tutorial is written for both average and advanced users to recover deleted files from memory card using cmd.

What's the Command to Recover Deleted Files from Memory Card, USB stick, Pen Drive or HDD?

"Hi, are you willing to share a detailed guide about how to recover deleted files from memory card using cmd? I heard that deleted files not in the recycle bin can be retrieved with command prompt, but I don't have a clue where to start. Cheers."

The command to recover deleted files from data storage devices like a memory card and a USB flash drive includes the dos command and attrib command. Whenever you accidentally deleted files and photos from SD card or formatted a USB stick, or emptied the Windows recycle bin, it's good to know how to use the command prompt to bring them back.

How to Recover Deleted Files from Memory Card Using CMD

It's said that there are two effective methods to restore permanently deleted files in Windows 10, 8 and 7, including the command prompt and online data recovery software. Generally, the former method is only recommended for advanced users who have some computer skills, while the latter is for both average and advanced users who demand a high rate of successful deleted files recovery from memory card, USB flash drive or other data storage devices.

Step 1. Use a card reader to connect the memory card where you deleted files to a Windows computer. Assuming that the drive letter of the card appears as drive G:.

Step 2. Press the Windows key + R simultaneously. In the search box, type cmd and press Enter. Now, cmd.exe is launched.

Step 3. Type the first command line: chkdsk G: /f and then press Enter. (Replace G with the exact drive letter of your memory card.)

Step 4. Type Y to allow the command to proceed.

Step 5. Type G: (the drive letter) again to go back to start again.

Step 6. Type [G:\>attrib -h -r -s /s /d *.*]. This attrib command will recover everything that you deleted off from the memory card.

How to Recover Deleted Files from Memory Card Using Software

Some people will encounter an error message that says "access denied as you do not have sufficient privileges". If you don't know how to continue, you'd better give up undeleting files using cmd. It's dangerous because a single mistake could result in a permanent loss, and no more solutions would be found.

Alternatively, download EaseUS free data recovery software and try to perform memory card data recovery in an automatic way. All you have to do is wait until the software finishes scanning the card and finding all the deleted files on it.

Usually, deleted or formatted data is not permanently removed. Stop using the memory card once you lost data on it. With powerful memory card recovery software, you can hopefully get lost data back.

Step 1. Run memory card recovery software

  • Connect the memory card on which you lost your files to your computer and launch EaseUS card recovery software - Data Recovery Wizard on your PC.
  • Select your memory card under External Devices and click "Scan" to start finding your lost files.
Select memory card to scan and find lost files.

Step 2. Scan to find all lost files from memory card

EaseUS Data Recovery Wizard will fully scan your memory card and find all your lost data on it.

Scan memory card to find lost files.

Step 3. Scan to find all lost files from your memory card.

After the scanning process, you can check and preview found files in this program.

  • Underneath Deleted Files, you can find your deleted memory card files there.
  • And if you formatted the memory card, you can check those files under Lost Partition Files.
  • And Filter will help you quickly find your lost files from Graphics, Documents, Videos, Audio, and Email, etc.

You can directly double-click the files to preview and see if found files are all right. After this, you can choose those files and click "Recover" to restore them to a secure location on your PC or other external storage devices.

Restore lost memory card data.