Recover Data from External Hard Drive Using CMD: 2024 Guide

Have no idea how to recover files from external hard drive using Command Prompt? Dive into this comprehensive tutorial for a step-by-step guide that enables you to restore your deleted or lost data with ease.

Posted by @Phoebe July 24, 2024 Updated By @Phoebe July 24, 2024

Can I recover deleted files from external hard drive using CMD?

 

 

"Hello! When I plugged my 1TB SanDisk SSD into my computer and found data on my external hard drive had gone. I have been using my disk for three years, and there are so many important photos and files stored on it. I cannot lose them. Is it possible to recover my data using CMD? I am a little reluctant to download additional data recovery software."

Source: SanDisk Forum

 

This user discovered that data stored on his or her hard disk disappeared and didn't know how to recover files from external hard drive using Command Prompt. Is it possible to recover files from external hard drive using CMD without data loss?

Yes, it is possible. CMD, short for Command Prompt, is a powerful built-in utility in Windows designed to troubleshoot and resolve specific issues with internal and external storage devices.

If you intend to recover deleted files from an external hard drive using CMD, it's crucial to understand a prerequisite: Command Prompt is effective for recovering data lost due to factors like accidental deletion, virus attacks, and corruption, but it may not resolve data loss caused by logical errors. For scenarios involving logical mistakes, professional data recovery software or services are recommended for successful data retrieval.

How to maximize the likelihood of successful data recovery

External hard drives have been widely used for expanding storage capacity, transferring files between different devices, creating backups, and transporting data. The longer you use it, the more data you store on it, and the more vulnerable the data becomes.

However, information is incredibly delicate and not entirely secure, regardless of where or how it is stored. The only sure way to retrieve lost data is to maintain a backup in advance. If there is no backup, you may still remember three tips to improve the chances of data recovery and avoid further damage once a data loss incident occurs.

▲ Stop executing "write" functions. A widespread belief says that once data gets deleted, it is actually not erased but exists in another file name. Hence once you conduct "write" operations such as editing, creating, and coping, the intact data will be overwritten and make it impossible to perform recovery. ▲ Don't reboot the drive. Rebooting causes the computer to write new files. So you are suggested to turn off the computer and not turn it on. ▲ Never format the external hard drive. Format would be the last resort. Once you format a disk, many hard drive issues can be solved, but all the data stored on it will be totally erased. Before formatting a disk, please try other recovery methods.

How to recover files from external hard drive using Command Prompt

As mentioned earlier, the probability of successful recovery using CMD depends on the specific circumstances of data loss. The following parts will delve into how to recover permanently deleted files using CMD.

Warning: Please follow the command line carefully. Wrong typing errors can cause severe consequences.

Recover files from external hard drive using attrib

How to recover files from external hard drive using Command Prompt? The first option is to use Command "attrib" which is designed to delete and set or display file attributes like read-only, hidden, system, and archive.

This command is applicable to: accidental deletion, hiding, and virus attacks data recovery.

Step 1: Connect the external hard drive to your computer.

Step 2: Press Win + R to open the Run window.

Step 3: Type "CMD," and press Ctrl + Shift + Enter to run Command Prompt as Administrator.

Step 4: Type "attrib -h -r -s /s /d F:\*.*" and hit Enter.

(Replace "F" with the exact letter of your external hard drive.)

Recover files from external hard drive using chkdsk

Command "chkdsk" is used to check a hard drive or other disk drives for errors and repair them if possible.

This command is applicable to: RAW or corrupted file system recovery.

Step 1: Run Command Prompt as Administrator.

Step 2: Type "chkdsk g: /f /r  /x" and hit Enter.

(Replace "g" with the exact letter of your external hard drive.)

Now check the drive to see if the lost files have been recovered. If these CMD methods do not fully recover your files, consider using a trusted third-party data recovery tool.

How to recover files from external hard drive using the best CMD alternative

While CMD is a powerful built-in utility, it has limitations in handling more complex data loss scenarios. For situations like emptied recycle bins, formatted disks, lost partitions, and system crashes, CMD may not be sufficient. Additionally, it's advisable to avoid using CMD unless you're confident in your commands' accuracy. A mistyped command can potentially exacerbate existing issues or create new problems.

In such cases, a dedicated data recovery program is necessary. We recommend using user-friendly options like AOMEI FastRecovery. The following points make AOMEI software stand out from all file recovery tools:

✿ Recover files from permanently deleted, corrupted, formatted, and more data loss scenarios. ✿ Restore Word, Excel, PowerPoint photos, videos, audio, emails, and more than 200 file types. ✿ Retrieve deleted files from external hard drives, USB flash drives, SD cards, HDDs, SSDs, and other storage media. ✿ Provide versatile partitioning, cloning, converting, and more advanced features.

Free DownloadWindows PCs & Servers
Secure Download

After making sure you have connected the external hard drive to your computer, follow the next instructions carefully.

Step 1: Install and launch AOMEI FastRecovery on your computer.

Step 2: Select a location to scan first to find the lost data on your Windows.

Step 3: It Will take some time to scan and find the lost data. Wait patiently.

Note: AOMEI FastRecovery provides two scan modes, Quickly Scan and Deep Scan. The Quickly Scan will search for your deleted data in the fastest way. The Deep Scan will make further search for other missing data.

Step 4: After the scan is complete,  here you can preview the recovered files, and select the ones you want to restore. Click "Recover".

Step 5. Select a folder path to store the recovered items and click "Select Folder".

Then the recovered files will be saved in the specified location.

Bonus: How to fix a corrupted and unreadable external hard drive

"I:\ drive is not accessible. The file or directory is corrupted and unreadable." is one of the most common partition corrupted errors that happen to the external hard drives. This can be caused by many situations: physical damage or failure, virus or malware infection, bad sectors or file system errors, and so on.

The good news is that fixing the issue can be easy. There are 4 tips you can use:

1. Check physical connections: ensure that the external hard drive is properly connected to your computer. Try using a different USB port or cable to rule out connection issues.

2. Use a different computer: try connecting the external hard drive to a different computer to see if the issue persists. this helps determine if the problem is with the drive or the computer.

3. Run CHKDSK: on Windows, open Command Prompt as an administrator, and run chkdsk /f X: (replace X with the drive letter of your external hard drive). Check for drive errors and repair them.

4. Use disk repair tool: If the drive remains unreadable, employ AOMEI Partition Assistant to diagnose and repair issues, including checking for bad sectors and resolving logical errors. Additionally, considering reputable data recovery services is advisable for reliable solutions.

Conclusion

This article mainly talks about how to recover files from external hard drive using Command Prompt. Two command lines - "attrib" and "chkdsk" are introduced in detail.

While CMD can be effective for certain data recovery scenarios, its capabilities are limited. For more complex data loss situations, especially those involving logical issues, using a dedicated data recovery tool like AOMEI FastRecovery is highly recommended. Besides the PC edition, this tool is also compatible with Windows Server operating systems for Windows Server users.