How to recover deleted files from USB using CMD?

"I connected my Kingston 64GB USB flash drive to the computer last night, hoping to continue editing my unfinished Word document, but found nothing. Maybe I accidentally deleted the Word file without making a backup. Someone told me I should try the command prompt, which might help easily recover the deleted files. The thing is, I know nothing about CMD! So could you please tell me how to use the command prompt to recover deleted files from USB flash drive without software?"

The Command Prompt (also called Command Line/CMD) is available on most Windows operating systems. It can execute commands to perform advanced administrative functions and troubleshoot or solve certain types of Windows issues. CMD, as a free built-in Windows utility, helps users recover lost files, fix bad sectors on storage devices, and even convert the file system from RAW to NTFS for free, among other things. On this page, we will focus on how to use the Command Prompt to recover files.

How to Recover Files from a USB Flash Drive Using Command Prompt (UTF-8)

The most commonly used command prompt is the attrib command. With this command, you can recover lost and hidden files from USB flash drives, hard drives, SD cards, or any other external disk if they have been hidden due to a setting error or a virus attack (such as recovering files from a shortcut virus).

Tip
This command prompt only allows you to recover hidden files from USB flash drive, not deleted ones. If your files have been permanently deleted, CMD won't be of help and you'll need to use a CMD alternative tool like the Data Recovery Wizard.

1. Press Win + R, then type cmd, and hit Enter to open the Command Prompt as an administrator. 2. Type chkdsk E: /f, then press Enter. (Replace E with the drive letter of the device where the lost file or data is located.) 3. Type Y, then press Enter to proceed. 4. Type G:, and press Enter again. (Replace G with the drive letter of the device where the lost file or data is located.) 5. Type attrib -h -r -s G:\*.* /s /d, then press Enter. (Replace G with the drive letter of the device where the lost file or data is located.)

While executing commands manually in the command line is suitable for computer-savvy individuals, the risks of inputting incorrect commands outweigh the benefits. For safety and ease of use, we highly recommend trying an automated command-line alternative, such as CleanGenius. This practical tool allows you to check and fix file system errors, enable/disable write protection, and update your system with a single click, eliminating the need to type complex command lines.

With this one-click repair tool, you can unhide files with these simple steps.

Step 1. Download the CleanGenius tool for free.

Step 2: Launch CleanGenius, and then select “Optimize” from the left pane. Next, click on “File Display” from the right pane.

Show Hidden Files - Step 2

Step 3: Select the hard drive and click Perform.

File Repair - Step 2

Step 4: When done, click on this link to view the hidden files.

Show Hidden Files - Step 3

Once you're done, restart your device, and the lost files should appear on your SD card, USB, or hard drive. If CMD didn't work for you, or if you need to recover deleted files from a USB flash drive or another storage device, continue to the next method to use the Data Recovery Wizard tool.

How to Use CMD Alternative Methods to Recover Lost or Deleted Files

Data Recovery Wizard Pro is the best CMD alternative tool to recover lost files due to accidental deletion, formatting, virus infection, file system corruption, OS crash, lost partitions, or other complex scenarios. With this ultimate data recovery tool, you can recover deleted files from an SD card, external hard drive, USB flash drive, thumb drive, HDD, SSD, and more.

If the lost data exceeds 2 GB, upgrade to the Data Recovery Pro version for unlimited recovery capacity. Download and install it on Windows 10/8/7, then follow the steps below to retrieve deleted files from your USB flash drive.

Step 1: Choose a location and start scanning

Launch the Data Recovery Wizard, and hover the mouse over the partition/drive where the deleted files were stored. Click on "Scan" to look for lost files.

Select the location from where you deleted the files

Step 2: Select the files to restore

Once the scan is finished, select the deleted files you want to recover. You can click on the Filter to display only the file types you need. If you remember the name of the file, you can also search for it in the “Search for files or folders” box – this is the fastest way to locate your target file.

Select the files to recover

Step 3: Preview and recover the deleted files

Preview the recoverable files, select the ones you want to restore, and click “Recover” to save them to a new location instead of the disk where the data was lost.

Recover Deleted Files