Recover Deleted Files from Memory Card Using CMD

Jean updated on Nov 17, 2020 to Storage Media Recovery | How-to Articles

This page tells you the detailed steps of how to recover deleted files from memory card using CMD. What's more, do not hesitate to try EaseUS SD card recovery software, which is specialized for all kinds of data loss problems, including deletion, formatting, partition loss, RAW, and other inaccessible issues.

CMD, as known as Command Prompt/cmd.exe, is available in most Windows operating systems. By entering a specific command, users can self troubleshoot certain Windows issues. Knowing useful CMD commands will let you have more control over your Windows PC.

"I'm trying to find a free method to recover some deleted photos from a 64GB SanDisk SD card. I heard that using CMD might work, but where should I start?" One user asked this question in a forum wondering how to recover the SD card using CMD. If you have the same question, in this article you will get the answer.

What is the Attrib Command?
Method 1.Recover Deleted Files from Memory Card Using Recovery Software
Method 2. How to Recover Hidden Files from Memory Card Using CMD
Method 3. Recover Hidden Files using CMD Alternative

What is the Attrib Command?

In rare situations, the memory card files are not showing up, missing somewhere, or disappearing without a trace, whereas most of the time, data are deleted or corrupted. The way you lost files from the SD card determines the possibility of whether the attrib command can get the data back or not. The attrib command is designed to display, set, or remove attributes assigned to files or directories. Microsoft gives a full explanation to the attrib command, along with some examples.

Let's make it simple. The attrib command is usually used to recover files hidden in SD cards/memory cards that have been attacked by viruses. If you have accidentally deleted files or photos from the SD card or got it formatted without a backup, there is no way to recover files from the SD card using CMD for Windows. Whenever you Instead, seek help from exclusive data recovery software.

Method 1.Recover Deleted Files from Memory Card Using Recovery Software

To achieve a high success rate of deleted file recovery from a formatted SD card, third-party SD card recovery software is recommended for you to try. EaseUS Data Recovery Wizard can perfectly replace the role of the attrib command in retrieving hidden files.

Unlike the CMD command which requests computer skills, EaseUS file recovery software is designed for all levels of users with an intuitive interface and plenty of auxiliary functions.

Video Tutorial of Recovering Deleted Files from Memory SD Card

It specializes in recovering data from all kinds of data loss problems, including deletion, formatting, partition loss, RAW, and other inaccessible issues.

Step 1. Select the memory card and scan

Connect the memory card to your computer and launch EaseUS card recovery software on your PC. Click "Scan" to start looking for your lost data.

select a location and click scan

Step 2. Wait for the scanning process to finish.

After the scanning process, you can check and filter wanted files in this program. Click "Filter" if you are looking for a specific file type.

select the memeory card files

Step 3. Recover wanted files.

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

recover memeory card files

Method 2. How to Recover Hidden Files from Memory Card Using CMD

If you lost the memory card files without an apparent reason, it's likely that they are hidden. Usually, the culprits can be a virus, malware, encryption software, or other system manners, such as Windows system update, reinstallation, and so on. You're supposed to unhide all the missing files and folders by using the following command lines. They'll return all invisible items to the original location until you execute the entered commands.

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.). Type Y to allow the command to proceed if asked.

Click to copy

You might encounter an error message saying that you don't have sufficient privileges. It's because you don't have administrator permission.

cmd without priviledges

Alternatively, press "Windows + X" keys and choose Command Prompt (Admin) to open the Command Prompt this time. Continue with the chkdsk command.

open command prompt as admin

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

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

Click to copy

Syntax explanation:

  • –h clears the Hidden file attribute.
  • –r clears the Read-only file attribute
  • –s clears the System file attribute.
  • /s applies attrib and any command-line options to matching files in the current directory and all of its subdirectories.
  • /d applies attrib and any command-line options to directories.

After clearing all the protected attributes of files, you could see one or more new folders appearing on the SD card again.

Method 3. Recover Hidden Files using CMD Alternative

Manual input of the command line is suitable for computer professionals since wrong commands can cause more severe problems. Therefore, for security and usability, we strongly recommend you try an automatic command line alternative. EaseUS Tools M is a practical tool that enables you to check and fix files system error, enable/disable write protection and system update with one-click instead of typing intricate command lines.

Follow the simple steps below to show hidden files with this 1-click-fix software. 

Step 1.  DOWNLOAD EaseUS Tools M for Free.

Step 2. Start EaseUS Tools M, choose "File Showing" on the left pane. Next, choose the target drive for scanning.

show hidden files - step 2

Step 3. After the operation completes, click the View button to check the hidden files. 

show hidden files - step 3

Was This Page Helpful?


Frequently Asked Questions

1. Why choose EaseUS Data Recovery Wizard?

"EaseUS Data Recovery Wizard is the best we've seen. It's far from perfect, partly because today's advanced disk technology makes data-recovery more difficult than it was with the simpler technology of the past, but it's fast and efficient..."PCMag

"The first thing you'll notice about EaseUS Data Recovery Wizard Pro is that its interface is very clear and uncluttered, with only a small collection of self-explanatory controls. You won't find lots of extra options hidden in a system of hidden menus, either; what you see really is what you get."techradar

"Recover lost files, even after deleting a partition or formatting your drive."Macworld

2. Why cannot I recover 2GB data for free?

It is recommended to check the version installed is Free or Trial because they are different versions.

Trial has data preview function but cannot save any files, while the Free version enables to recover 2 GB files. The default free space is 500 MB and you may share the product on social media to get another 1.5 GB.

3. Why cannot the recovered files be opened?

A file is saved as 2 parts on the storage device: directory info (which is comprised by file name, time stamp and size info, etc.) and data content.

If the files with original file names and folder structures cannot be opened, one possible reason is the corrupted directory info. There is still a chance to recover the data content with the RAW Recovery method in our software.

4. Why isn't it suggested to recover the files back to the original drive?

The storage structure of the lost files would be altered or damaged by any changes on the drive. If you save the recovered files back to the same drive, the original data structures and data content would be corrupted or overwritten, which causes permanent data loss. So you should prepare another disk to save the files.

5. How can I check whether my data is recoverable or not before purchase?

The Free version helps you save 2GB files, so verify the recovery quality of our product before purchase.

6. How long does it take to scan the drive?

It strongly depends on the capacity of your hard drive and the performance of your computer. As reference,most drive recoveries can be completed in around 10 to 12 hours for a 1-TB healthy hard drive in general conditions.

About Data Recovery Wizard

It's super easy to recover 250+ types of files after deletion, disk formatting and virus infection. Click the links and compare the difference of each version.