CMD, the acronym of Command Prompt, is actually a command-line interpreter application you can find in any Windows operating system. This tool provides you with a command-line interface to interact with the system. You can zip files, manage disk and partition space, modify drive properties, solve disk problems, and recover files using CMD.
This post explores how to maximize the data recovery capabilities of the Command Prompt. You can use different command lines to rescue your data in different cases. Please keep reading to recover your lost data.
Recover Files Using CMD: Exact Steps
Command Prompt is a snap-in tool in Windows systems, so you can open and use it easily for disk management, error fixing, and data recovery. Your data can get lost due to a lot of reasons, such as accidental deletion, formatting, and virus attack. Therefore, it’s necessary to teach you how to recover files using Command Prompt in some popular cases.
How to Recover Deleted Files Using Command Prompt
Generally, I advise you to check Recycle Bin when you delete files but find them still useful. Recycle Bin gives you a second chance for your mistaken deletion; it will store the accidentally deleted data for a certain period of time. Therefore, you can recover deleted files from Recycle Bin easily by dragging the files out directly or right-clicking on needed files and choosing Restore.
When you have emptied the Recycle Bin or the file has been permanently deleted, what should you do to get them back? Definitely, you can consider recovering permanently deleted files with Command Prompt or third-party data recovery software.
Solution 1: Recover Deleted Filed with Command Prompt
The winfr command line is widely used to recover lost data. It can be used to restore files like PNG, Office files, ZIP, and so on.
Step 1: Press Win + R to open the run window.
Step 2: Type cmd and press Shift + Ctrl + Enter to run Command Prompt as administrator.
Step 3: Type winfr source-drive: destination-folder: [/mode] [/switches].
You can replace mode with regular or extensive.
- regular mode represents standard recovery for non-corrupted NTFS drive
- extensive mode refers to the recovery option for all file systems.
Different switches have different functions:
- /n means to filter files with specific conditions.
- /! means show more advanced functions
For example: if you want to recover .png photos on drive G: to drive C:, then you can use the command: winfr G: C: /extensive /n *.png
Step 4: Click y to start the scan process.
Step 5: Wait for the process to end.
You can find the recovery files in the destination folder.
How to Recover a Formatted Hard Drive Using CMD
When you format a drive but find vital files are stored in it, how to recover them? Luckily, you can run Command Prompt to rescue your data. CHKDSK and attrib commands are widely used in recovering files. They also work well in rescuing files from formatted hard drives.
Step 1: Press Win + R to open the Run window.
Step 2: Type cmd and press Shift + Ctrl + Enter to run Command Prompt as administrator.
Step 3: Type chkdsk x: /f and hit Enter.
Please replace x with the drive letter of the formatted drive.
Step 4: Type y and hit Enter to continue.
Step 5: Type the drive letter of the formatted drive and hit Enter.
Step 6: Type the command: attrib -h -r -s /s /d *.* and press Enter.
What do these parameters in the attrib command mean?
- -h: it gives the Hidden attribute to the files specified.
- -r: it refers to the read-only attribute (files can be read but cannot be changed).
- -s: it gives the System attribute to the files specified.
- /s: it tells the system to search the specified path (including subfolders).
- /d: it consists of process folders.
How to fix access denied when running attrib command?
Step one: make sure you are running Command Prompt as administrator.
Step two: check if there is any file in use.
The access will be denied if any files contained in the target drive are still used by other programs when you are running the command.
- Please close the programs and try again.
- If this fails, you need to start the computer in Safe Mode when you can’t track down the files.
Step three: check if you have enough permissions. You can read this passage to find detailed steps: How To Take Ownership Of Folder In Windows 10 By Yourself.
Step four: please try to run the chkdsk /fcommand on the target drive from a DOS Command Prompt.
However, what if the hard disk is an internal drive that is necessary for booting the system? How to recover data from a hard disk using Command Prompt in this case? Then, you are supposed to boot your PC in Safe Mode and use CMD to recover files on it and repair the hard drive.
How to Enter Safe Mode in Windows 10
Step 1: Click the Start menu and select Power.
Step 2: Press and hold the Shift key.
Step 3: Click on the Restart choice.
Step 4: Wait for your computer to enter the Choose an option window.
Step 5: Navigate to Troubleshoot > Advanced options > Startup settings > Restart.
Step 6: In the Startup Settings window, press F6 to enter Safe Mode with Command Prompt.
Then, you can use the chkdsk and attrib commands to recover your files.
To know how to repair a hard drive, you can go to this passage: How To Repair Hard Drive and Restore Data in Windows 10/8/7 Free.
Besides, a more convenient way to recover files under various situations is using MiniTool Power Data Recovery. This free data recovery software can retrieve your data safely and you don’t need to worry about improper operations which may lead to system issues.
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
Recover Lost Data with MiniTool Power Data Recovery
If you fail to recover files with the Command Prompt, you can ask third-party data recovery software for help. Professional data recovery software can restore your files safely, like MiniTool Power Data Recovery.
MiniTool Power Data Recovery helps millions of people rescue their files from corrupted devices, formatted drives, unbootable computers, and so on. It can recover files from external and internal hard drives, USB flash drives, memory cards, and other data storage devices. Besides, this software supports scanning specific locations like the desktop, Recycle Bin, and the selected folder, which can save time to a great extent.
The free edition allows you to restore up to 1GB of files. You can try MiniTool Power Data Recovery free first to scan and check your important files.
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
Step 1: Download and install MiniTool Power Data Recovery.
Step 2: Launch the software. If the lost files are stored on an external hard drive, please connect the device first, then run MiniTool Power Data Recovery.
Step 3: Select the partition that contains the deleted files and click Scan.
Step 4: Please wait patiently until the scan process ends. Then, you can look through the result page to find your wanted files.
Generally, the found files will be divided into three folders: Deleted Files, Lost Files, and Existing Files. You can select the corresponding path to find the wanted files.
Filter: to filter files with file size, file type, file category, and modified date.
Type: to classify files according to their different types like archives, photos, audios, etc.
Search: to quickly locate specific files with their names.
Preview: to verify the correction of the selected file.
Step 5: Select the files you want to recover and click the Save button.
Step 6: Choose a save path in the popup window and click OK.
If you require a larger capacity, you can get a premium edition from this page. MiniTool provides Personal and Business editions. You can choose one based on your needs.
Last Words
The Command Prompt is a powerful tool that is built in Windows systems. It is able to help you manage flash drive/hard disk (format partition, deleted partition, etc.) safely. In addition, it can be used to recover files under various situations.
This post tells different command lines to help you recover files and repair some data storage devices. If you want to rescue files in a safer and easier way, you can try MiniTool Power Data Recovery.
MiniTool Power Data Recovery FreeClick to Download100%Clean & Safe
Feel free to share your questions with us via [email protected].