How to Recover Deleted Files Using Command Prompt?
Summary: Now day's there are many methods available to recover deleted data. And the most affordable way to recover data is via using command prompt however, it is little technical. This guide has detailed steps you need to follow for recovering data using command prompt.
Contents
Command Prompt can troubleshoot certain issues related to Windows including external hard drive recovery, memory cards and flash drives recovery. Being one of the most powerful inbuilt utility tool, it helps users to retrieve the files lost due to accidental deletion, virus attack. Along with it, Command prompt repairs bad sectors on storage devices and convert Raw File System to NTFS for free. So if you have accidentally deleted or lost files, you can simply use Command prompt to recover it.
File Structure:
Before going further let’s understand the file structure first
A file consists of two parts:
✓ A directory which consists the file name and the list of the blocks
✓ The actual blocks which contain the data
When a file is deleted, only the directory is removed whereas the actual block if not overwritten or modified, still contains the files. Thereby, the directory entries are marked ‘available’ and are hidden from the Operating System. In such cases, you can easily recover your lost files using the command prompt.
Recover your files using Command Prompt:
One of the most effective methods to recover deleted files from the external drive is through Command Prompt. Command Prompt executes commands to perform the assigned task. That said, there are some commands, which can recover your deleted files. They are as follows:
1. Recover files from your external drive
If you have accidentally deleted files from the storage drive such as hard drives, USB, flash sticks etc. Follow these commands in command prompt:
i. Press Windows key + R and in the search box, type CMD
ii. In the Command Prompt window, type chkdsk ‘drive letter’ /f and hit Enter.
For example: C : \ USERS\ PROGRAM FILES\ chkdsk D : /f
iii. Press Y until the command lines start again
iv. Type the drive letter again and hit Enter (The command line will go back to the start)
v. Now, type [drive letter : \ >attrib –h –r –s /s /d *.*]. This command will recover all the files in the storage drive (attrib -r -s drive:\<path>\<foldername>)
Where,
–r is Read-only attribute: Files are readable and cannot be changed
–s assigns ‘System’ attribute to the selected files
–h command assigns the ‘Hidden’ attribute to the selected files
‘/S’ implies to search the specified path including subfolders
‘/D’ command includes process folders
vi. Once the process is complete, a new folder is created on your external drive with all the recovered files. Probably, the files will be in .CHK format. Change the file format and save the files at the preferred location
2. Restore files from Recycle Bin using Command Prompt:
When the Recycle Bin becomes full, Windows deletes files to make space for the newly deleted ones. However, these removed files are still recoverable until the Recycle Bin is emptied.
Follow these commands to restore files from Recycle Bin:
i. In the command prompt window, type: start shell:RecycleBinFolder and press Enter
For example: C:\> start shell:RecycleBinFolder
ii. Select the files and restore them
Recover files when command prompt does not help you
Even though you can recover deleted files through Command Prompt but the prerequisite is that you must be familiar with technical jargons. The reason being, you have to type in many commands and if you’re not familiar with the command lines, then it may seem complicated.
Furthermore, Command Prompt cannot recover files from a formatted storage drive, for that you need to leverage an external drive recovery software. Stellar Data Recovery- Standard for Windows software can assist you in recovering your deleted files from the external drive hassle-free. It doesn’t require any familiarity with the command lines and is quite easy to use.
Watch this video to see how easily Stellar Data Recovery- Standard for Windows recovers lost or deleted data
Afterpiece
You can perform advanced administrative functions via Command Prompt. But you need to get familiar with each parameter and how they can be combined to achieve the desired result. Sometimes, the process gets complicated. On similar lines, recovering deleted files should be a simple and hassle-free process and that is when Stellar Data Recovery- Standard for Windows rises to the occasion.
Hello Isha, I put a bit-locker encryption to my external hard drive using windows 10. But when it was locked, i tried many times to unlock it by using the password and bit-locker recovery key but it didn’t open. It display “incorrect password” when I enter password. I’m 100% sure that the password and the bit-locker recovery key is correct. I’ve also updated windows 10 but my problem didn’t solve. Please help me to recover my data or to unlock my external hard drive. I’ll be very very very thankful to you.
Hello Aqib,
Unfortunately, we didn’t help you much unless the hard drive is unlocked. The data recovery software can’t able to work on the locked hard drive.
We suggest to hit & try password again, in case of any success Stellar Data Recovery Software for Windows can be helpful.
Hi Isha,
Thanks for the above information.
I accidentally deleted all the files from my external hard drive.
I followed the procedure from the Command prompt, but getting the below error.
C:\Users\NV>attrib -H -R -S /S /D G:\*.*
Access denied – G:\$RECYCLE.BIN\S-1-5-21-1072449878-812698141-267826086-1000
Access denied – G:\$RECYCLE.BIN\S-1-5-21-3216060475-3821369746-1632863026-1002
Access denied – G:\$RECYCLE.BIN\S-1-5-21-3763746185-820522019-1832817767-1001
Access denied – G:\found.000
Access denied – G:\System Volume Information
Can you help me with below?
Hello Nirav,
As per your query we recommend you to use our demo version of Stellar Windows Data Recovery- Pro software. You can download it from the below link:
Download Link
We would like to inform you that free download is used to scan the drive and after the scan, it will show you all the lost files which can be recoverable by using the purchased version. In case you are unable to see the files listed inside the application then we recommend you to contact support team on their below email address:
support@stellarinfo.com
Sounds great. Keep up the great spirit.
Thanks Alana
If you correctly use command prompt, it is one of the strongest in-built utility tool. With the correct knowledge of commands the dependency on third party tools reduce to minimum.
Hello Eric,
Appreciate the feedback.
If you correctly use command prompt, it is one of the strongest in-built utility tool. With the correct knowledge of commands the dependency on third party tools reduce to minimum.
Hello Tim,
Its a great inbuilt tool. Thanks for the comment.
Your site is so fantastic. I learn many important things from this post.
Hello Baron,
Thanks for reading the post.
Hi i mistakenly formatted my hard drive disk with cmd and lost everything can you help me recover my lost files..with cmd
Hello Bryan,
One of the most effective methods to recover deleted files from the external drive is through Command Prompt
i. Press Windows key + R and in the search box, type CMD\)
ii. In the Command Prompt window, type chkdsk ‘drive letter’ /f and hit Enter.
For example: C : \ USERS\ PROGRAM FILES\ chkdsk D : /f
iii. Press Y until the command lines start again
iv. Type the drive letter again and hit Enter (The command line will go back to the start)
v. Now, type [drive letter : \ >attrib –h –r –s /s /d *.*]. This command will recover all the files in the storage drive (attrib -r -s drive:\
Where,
–r is Read-only attribute: Files are readable and cannot be changed
–s assigns ‘System’ attribute to the selected files
–h command assigns the ‘Hidden’ attribute to the selected files
‘/S’ implies to search the specified path including subfolders
‘/D’ command includes process folders
vi) Once the process is complete, a new folder is created on your external drive with all the recovered files. Probably, the files will be in .CHK format. Change the file format and save the files at the preferred location
If the above methods didn’t able to recover, we recommend to try Stellar Windows Data Recovery Software.
Hi Isha 🙂
I need your help. Please answer my questions. Thanks in advance.
Question 1
Lately, I can’t get to my log in page. It was on a cooling system problem. I have no choice since whenever I tried to reboot it, it just failed. So, I figured, it might be the fan prob. Then, I sent it so that the fan prob can be fixed. Did I made the right choice here?
Question 2
I dont know my diagnosis of the failure of getting to my log in page. But, I have to reformat my laptop. Windows 10 is installed. Backup of files was not done. I dont want to know why this is the solution to my problem.
Can you please help me. I want my old files back. I dont know how to locate it. I think I need them back. Also, I dislike this new windows. I want to reinstall my previous windows 7 back. But most importantly, how to get back my files? Is it possible to not lost any files without having them back up. Which option is safer?
I want to find my files by myself but I dont know how to look for it. Can you help me? I am looking forward to your reply. Thank you for your kind attention.
Hello Ryda,
Thanks for contacting Stellar Data Recovery
Answer 1: As you have a fan problem with the system so it need to be resolved by the manufacturer.
Answer 2: We have Stellar Windows Data Recovery Professional software to recover the lost data. However software cannot reload your previously installed Windows operating system.
We recommend you to download the demo version of the software from the below mentioned link:
Download Link
After installing the software, kindly run it and perform the scan using ‘Can’t Find Drive’ option to search for the volumes. Once the volume is listed then please run the scan to check the possibility of recovery.
Thanks Isha for this tip
I never imagine to recover deleted files in such simple manner.
Hello Codey,
Thank You for the nice words.
I appreciate your blog! for aware to recover deleted files . I go with the second one used this software for recovering a deleted file. Thanks!
Hello Jamey,
Thanks for contacting Stellar
Thanks for using our software. Please dont forget to follow us on twitter, facebook and youtube.
I follow these commands to recover our lost data from Hard drives. Thanks for giving such wonderful information!
Hello Genie,
We are glad that you tried our given method.
You may also subscribe to our newsletter for more offer and updates.