If the pictures on your external hard drive, flash drive, or memory card are missing, you may be able to recover them using the Windows command prompt. While data recovery tools are usually best for the job, using the "chkdsk" and "attrib" commands can often restore corrupt files, as well as files you thought were permanently deleted by malware like the USBC virus. This wikiHow article will teach you commands you can use to undelete photos from any external drive or memory card.

Steps

  1. 1
    Go to CMD. Press the Windows key + R then type cmd or just search the CMD in the start menu.
  2. 2
    Type chkdsk "drive letter" /f then hit Enter. This is the first line of code that we are going to use in the recovery process. Make sure that everything is separated with a single space.
    • ex. C:\Users\TheVirtualWriter>chkdsk E: /f
    Advertisement
  3. 3
    After hitting the enter button, type Y to those preceding commands until command line starts again. Do not panic if there are a lot of commands appearing on the cmd window. These commands are one of the process of recovering the file. Just type (Y) to those command questions to proceed.
  4. 4
    Type the drive letter again then hit Enter. [ex. C:\Users\TheVirtualWriter>E:]. The command line will go back to start again after scanning the drive and converting the files inside.
  5. 5
    Type [E:\>attrib -h -r -s /s /d *.*]. This is the last line of command that we are going to use. This will recover everything that is inside the external drive.
    • After typing the code, a new folder will be created in your memory stick and this folder holds all the photos that are recovered on your memory stick.
  6. 6
    Copy everything and then change the file name extension from .CHK to .JPG. All the files will be in .CHK format. They are the recovered files. Just change the file name extension in order the files will appear and recovered. This step need patience because you are going to change them manually one by one.
  7. Advertisement

Community Q&A

  • Question
    Im getting a message which states "access denied". What can I do?
    Community Answer
    Community Answer
    You may need to run CMD as administrator, or it could deny access, as many features are not enabled to other users.
  • Question
    What do you mean by, "This will recover everything that is inside the external drive" in step 5? Does it also include videos?
    Community Answer
    Community Answer
    They mean that no data inside the external drive will be lost, including videos.
  • Question
    How do I make sure I have privileges to run command prompt?
    Community Answer
    Community Answer
    On the command prompt window, be sure that the window's title is "Administrator: Command Prompt."
Advertisement

Things You'll Need

  • laptop or desktop
  • external drive like memory stick, USB, etc.

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 59,307 times.
How helpful is this?
Co-authors: 6
Updated: November 24, 2021
Views: 59,307
Advertisement