[LATEST] How To Recover Lost Files Using Command Prompt (CMD)

Last Updated: 2021-12-22

Summary: In this article, we will walk you through how to recover lost files on Windows 10 using command prompt (CMD) from various storage mediums and the easy-to-use data recovery tool – Bitwar Data Recovery, which requires only a few clicks to get back the wanted data.


Understanding Command Prompt (CMD)

Command Prompt is a handy built-in Windows utility that allows the users to retrieve files lost due to accidental deletion, virus attack, corrupting, and hiding. Using Command Prompt or CMD, you can retrieve files from devices like pen drive, USB, hard disk and memory card, etc. This utility comes pre-installed on Windows devices and absolutely free to use.

However, it comes with some demerits such as:

  1. It might be tricky for beginners as it requires entering Command-Line manually.
  2. Not so powerful as compared to alternative recovery tools.
  3. Not capable of recovering files lost due to complex scenarios such as permanently deleted files.

Nevertheless, the disadvantages come with advantages. Therefore using CMD is an optional solution for some advanced users who would love DIY data recovery to manually recover data from hard disk, USB flash drive, SD memory card, the external hard drive on Windows 10, 8, 7.

We will show you directly how to recover permanently deleted files using CMD on Windows 10 from different locations or partitions. In case you are unable to recover permanently deleted files using Command Prompt (CMD) with the below solutions, there is still an alternative method to recover data by using a data recovery tool so let’s get started now!

How to Recover Lost Files using Command Prompt (CMD)

Part 1: USB Drive

CMD attrib command is used only to fix how to recover hidden files using CMD. If you see that your files are not in place due to some reason, you can try to use the Attrib command to check if they are hidden somewhere.

Step 1: Connect USB to your computer system.

Step 2: Go to the Start and type cmd in the space given or search menu, followed by hitting enter.

Step 3: You will be able to see cmd.exe listed under programs and right-click on it.

Step 4: Type the command:attrib -h -r -s /s /d drive letter:\*.*  in the command window, and press enter to execute.Command Prompt

Note: Using this command, you should be able to retrieve your virus-deleted files. This command will not work if data is lost due to formatting, partitioning, or files are deleted permanently.

Part 2: Recycle Bin

Generally, if you send the files to the Recycle Bin by mistake, the files can be recovered by right-clicking on them or using the command line to restore them to their original state or location. What if you are willing to recover deleted files from Recycle Bin? Please follow the steps below:

Step 1: Go to the start and type cmd in the search menu again, followed by pressing the enter key.

Step 2: After this, select cmd.exe by right-clicking on it from under the programs list.

Step 3: Type the command: start shell: RecycleBinFolder and hit enter.

Recyclebin CMD

Step 4: Choose the files you want to recover.

Part 3: Formatted Hard Drive

The command prompt on Windows is capable of recovering files after reformatting a hard drive. Still, you have to run the command prompt as administrator and continue with the steps below:

Step 1: Go to the search menu again and launch the command prompt CMD as administrator.

Step 2: Type in diskpart and tap enter.

Step 3: Continue with typing in list disk and enter again.

Step 4: Type select disk X and tap enter. (Replace X with your disk number)

Step 5: Lastly, type rescan and tap enter again.

rescan hard disk

Step 6: Wait patiently for the scan to complete and check whether the files are restored safely after the scan.

Part 4: RAW Partition or Drive

Sometimes users may lose their files from an external storage drive after connecting it to the computer due to RAW partition or drive. So all you need to do is to log in using your administrator account and password if it asks for and follows the steps below:

Step 1: Launch the command prompt and type the command: chkdsk X: /r/f followed by hitting enter. (Replace X with your drive letter.)

command prompt cmd

Step 2: Type the command diskpart and press enter.

Step 3: Then, type rescan and then press the enter key.

Step 4: Exit from DiskPart and type the command:chkdsk /f X: in command prompt and press Enter. (Remember to replace X with your drive letter, from where the data was lost.)

Finally, wait for the process to get over and then check if the lost files were recovered or not. In case you are unable to recover lost files using Command Prompts shown above, it’s recommended to use the alternative data recovery tool to get back all the possible data easily and quickly!

Alternative Tips: Data Recovery Tool for Windows

Bitwar Data Recovery software can help you easily and quickly recover no matter the images/photos, documents, videos, audios, archive files, and other files from any storage mediums on Windows 10, 8, 7, or the last macOS. Most importantly, it is capable of recovering the data from various data loss scenarios and offering a simple step-by-step model that is easier to follow than the command prompt. You are much clearer about which mode you can use to recover the wanted files.

Besides, all of the users can completely do-it-yourself to perform successful data recovery in Bitwar Data Recovery Software with a few clicks and minutes if recover lost files using Command Prompt finally turns failure:

Step 1: Download and install the data recovery tool from Bitwarsoft Download Center.

Step 2: Select the drive or partition from where the file is deleted and press the next button.

main interface

Step 3: Choose the scan mode and click on the Next button.

scan mode

Step 4: Choose the file types you wish to restore and press on next.

file types

Step 5: Preview and select the file you need and click recover to start the data recovery process.


Note: After you have successfully recovered all your data, save it at some safe location. It is advised not to save the recovered data back to the drive where you lost it from.

FAQ To Recover Lost Files Using Command Prompt

We will share with you some of the most frequently asked questions among users when they want to learn how to recover lost files using Command Prompt. Hopefully, the sources below can be helpful to all of you!

What is the Purpose of Command Prompt Attrib?

Command Prompt Attrib is a command line on Windows that allows MS-DOS or users to change the attributes of a file on their computer. Therefore, it can help users to retrieve some of the hidden files on the computer. Besides, it is supported by most of the Command Prompt in all versions of Windows operating systems such as Windows 7, Windows 8, Windows 10, Windows XP, Windows Vista, or other older versions.

What is a CHK file?

To explain it easier to understand, it is actually fragmented files that are created when any writing process of the file is stopped accidentally in a drive or unexpected shut down of your computer. So, the CHK file is also a file extension for any temporary file format that are existed in Windows, and you can basically call it corrupted data. So users can recover corrupted files using chkdsk command prompt.

What do these Parameters mean in Command Prompt Attrib

  • -h: commands the hidden attribute for specific files.
  • -r: states for the read-only attribute.
  • -s: refers to the System attribute for specific files.
  • /s: to search for a specific path.
  • /d: means there are consisting of folders process.

Recover Lost File Now!

Command Prompt (CMD) is a useful feature on the Windows system that allows you to easily o recover lost files. However, this feature is not a guaranteed recovery way when it comes to complex data recovery. Therefore, during such scenarios, you should rely on the powerful data recovery tool – Bitwar Data Recovery to restore lost data from internal or external devices.

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

Previous Article

How to Switch App Store Account In iOS 14? Summary: In this article, we will walk you through how to recover lost files on Windows 10 using command prompt...

Next Article

2021 Best Ways to Fix Windows Explorer Needs To Restart Summary: In this article, we will walk you through how to recover lost files on Windows 10 using command prompt...

About Bitwar Data Recovery

3 Steps to get back 500+ kinds of deleted, formatted or lost documents, photos, videos, audios, archive files from various data loss scenarios.

Learn More

Hot Articles

    Related Articles