How to Recover Deleted Files Using Command Prompt

Data recovery software

There was a time when permanently deleting files was considered as the end of it. Only the time machine could undo the damage that was done accidentally. Times have changed, and our time machine can be kept under the wraps.

When you first delete the files, they get sent to the Recycle Bin, unless you are doing the permanent delete using Shift+Delete. That is when things become increasingly difficult to bring back the accidentally deleted files.

While there are few ways at hand that can be tried for recovering files, we go with the most mechanical way before trying our hands on the third-party applications—Windows ships with an internal file recovery tool, accessible via the command prompt.


Things to keep in mind

  1. Excessive overwriting of the location where the file was deleted from can result in failure of recovery software to recover the files.

Traces fade out of the deleted files whenever the new files, folders are written on the same location of the hard drive.

  1. Places in the harddrive with corruption, bad sectors will have difficulty in recovering files.

– Recover files using CMD

The command prompt is packed with hidden utilities that come in handy in virtually all the scenarios involving general Windows operations.

CMD has specific attributes that can be entered to recover files/ folders deleted from your storage, flash drive, and even in the Recycle bin.

  1. Head to the start menu and type “CMD” press ENTER.
  2. When the command prompt window has opened up, type the following and press enter

attrib -h -r -s /s /d G :\*.*

Here the letter G denotes the drive letter from where we want to recover files. After the scan has finished, a new folder will be created with recovered files in Chk format.

CHK is the file extension used for temporary files on Windows.

The parameters in the attrib command mean the following

  • -h: Provides hidden attributes to the files
  • -r: Read-only attribute
  • -s: It provides system attributes to the specific file
  • /s: Instructs the tool search for recovery in specific sub-folders, directories
  • /d: All the process folders are covered with this command

– Recover files using Wondershare Recoverit

Not everyone likes shuffling around with commands and the not-so-friendly UI of command prompt. It makes people nervous even to try commands as not everyone is good with computers.

No worries. There is a more comfortable and efficient way is available. Wondershare has developed its new recovery utility tool that does the job of recovering jobs efficiently without requiring advanced knowledge of computers.

  1. Recover deleted files from Partitions

Suppose you have just formatted a partition while installing windows to only later realize that some of your important files were present on the wiped out partition.

Or, you went on a cleaning spree and deleted some files that were important for the other person using the computer.

It’s time to bring back to those files without any further ado.

  1. Download, and install the Wondershare Recoverit.
  2. Launch the program, and the option to select the drives of your choice will appear in the top section of the wizard.
  3. Select the drive which you want to scan for recovering the deleted files. We selected drive C for the sake of this tutorial.
  4. Click on the Start button given at the bottom of the recovery wizard.It will take a little bit of time to scan for the deleted files. The duration will depend on the size of the partition.
  5. Once the scanning is complete, the files will be displayed in the form of a directory, followed by folders where the files will be found.
  6. Peruse through folders and directory to find the relevant files.Double click on any file to preview, if it’s available.Alternatively, you can also use the search bar for searching through files if you remember the name correctly.
    The search functionality offers advanced search features such as search by file types, date of modification, system files, and more.If you are unsure of the files or don’t remember the name itself, then the Preview feature is here to save the day for you.

Select a file and hover to the rightwards bar, click on the preview button.

  1. Tick the box next to the files that you wish to recover.
  2. Click on the Recover button, and it will ask for the location to save the recovered files.
  3. After selecting the location, click on Recover, and it will open the newly created on the location of your choice.
  4. Recover deleted files from Flash/USB drives

We carry around flash drives everywhere to transfer and carry files with us. Sometimes few of the files either get misplaced or deleted by accident during USB drive corruption.

They can also be recovered using the Recoverit application.

  1. Open the main window of Recoverit and head to the External drives.
  2. Select the USB/Flash drive, which you want to scan for recovering deleted files.
  3. Choose the files which you want to recover and click on Recover.The recovery process will continue in the same manner as we did with the partitions.

That’s not all

You can also recover files from the Recycle bin, Desktop, and a particular folder.

Recycle bin is amongst the most used locations, overwriting every so often that it may become difficult for ordinary recovery software to do anything about it. We were able to recover files that were deleted around one year earlier.

Meanwhile, the folder option comes in handy when time is of the essence. Folder recovery is a targeted recovery meant for specific folders, saving time, and having a higher accuracy result.  Besides, you can also learn to recover deleted files without software. However, it will be easier with Wondershare Recoverit.


Recovering files can be a headache when the missing/deleted files are scattered across the computer.

Also Read:

Download Outdated drivers

Recover Deleted Files using Command Prompt

Recover Deleted iPhone Messages

It is recommended to practice deleting, disciplining, and avoiding permanently deleting the files. Let the files and folders land in the Recycle Bin for review before emptying the bin. The Recycle Bin acts as a fail-safe for deletion accidents.

This post was last modified on April 19, 2024 8:05 PM

Yogesh Patel: Yogesh Khetani is a famous Tech Blogger who loves to be surrounded by tech gadgets. So obviously, we can see his contribution here in that field. He also contributes to Now I am Updated website.