How To Fix Corrupted Flash Drive Using CMD (Command Prompt)

Using data storage devices like pen drives, SD cards, microSD cards, or other external hard drives have become common nowadays. But, sometimes it happens that due to some unexpected reasons, your flash drives get corrupted or damaged. When users are unable to access the data stored within the corrupted drive then they get upset and don’t get anything to do. So, here I are going to tell you how to fix corrupted flash drive using CMD option.

Apart from that, you will also get the best USB Flash Drive Data Recovery tool to retrieve your lost files which has been deleted while fixing this issue.

Rated Excellent on Trustpilot
Free Hard Drive Recovery Tool.
Recover data from USB drives, Pendrives, SSDs, HDDs, and other devices on Windows. Try now!

But, before I move ahead to fix USB flash drive cmd or repair Pendrive using CMD, let’s take a look at the common causes that can make your USB flash drive corrupted or damaged.

Causes That Can Make Your USB Flash Drive Corrupted

There could be several reasons that can lead to a corrupted USB drive/external hard drive. A few of the major factors are as follows:

  • Virus or malware infection.
  • System files corruption.
  • Availability of bad sector.
  • Connecting USB flash drive to multiple PCs or Mac.
  • And so on…

It doesn’t matter whatever the causes are, there are a few effective solutions that you can follow to know how to fix a corrupted flash drive. And one of the popular methods to fix corrupted flash drive using CMD command.

So, here comes the solution section – how to repair a corrupted flash drive using CMD (command prompt)?

How To Fix Corrupted Flash Drive Using CMD (Command Prompt)

The CMD command is also known as the command prompt is one of the high-rated and successful solutions to repair corrupted, not working, or unrecognized flash drives, pen drives, SD cards, or hard drive. It can also be used to repair corrupted external hard drive, SSD, or HDD with ease.

Note: The solution works great on Windows 10/8/8.1/7 computers.

Here is how to fix corrupted USB using CMD or how to repair flash drive using CMD in complete steps:

Step 1: Connect the corrupted flash drive (pen drive, memory stick, SD card, or external hard drive) to your Windows computer.

Step 2: Click START and type CMD in the search bar and hit ENTER to open the command prompt. Alternatively, you can also open the command prompt by pressing Windows Key + R followed by typing CMD in the RUN box that pops up.

Step 3: Now in the command prompt box, type the following commands:

  • Type diskpart and hit ENTER button. After this type list disk and hit ENTER button.

Step 4: Next, type select disk followed by the number of your disk and press ENTER button. After you select your disk, type clean and press ENTER button.

Step 5: Next type create partition primary and hit ENTER.

Step 6: After this type active and press ENTER followed by select partition 1.

Step 7: Finally, in the last step type the following command format fs=fat32 and hit ENTER button.

A screenshot of the process is given below.

Repair corrupted Flash Drive Using CMD

After the completion of the process to fix pendrive using cmd, you should find your USB drive working as well as new.

Alternatively, there is another step to fix/repair corrupted USB flash drive using CHKDSK command.

You May Also Like: [Best Guide] How To Fix USB Flash Drive No Media Error In 10 Easy Ways

Repair Corrupted USB Flash Drive Using CHKDSK Command

In order to solve how to fix corrupted flash drive without losing data using CMD, follow the steps:

  • Connect the corrupted flash drive to your PC.
  • On your computer click Start and type CMD in the search bar and hit ENTER.
  • A new command prompt window will get open.
  • Now type the following command: chkdsk /X /f H: or chkdsk H: /f and hit ENTER. Here you need to replace the H: drive with your corrupted pen drive/SD card/USB drive.

how to fix corrupted USB using CMD

Just wait for the process to get complete and then you should find your USB flash drive working as good as new. Also, with this, you will be able to know how to recover corrupted files from USB using CMD after you fix flash drive using CMD.

Expert Tip: Recover Lost Data From Corrupted USB Flash Drive

While performing the above solutions to fix corrupted flash drive using cmd or repair USB using CMD, you may encounter data loss from your flash drive. So, after solving how to repair Pendrive using CMD, it is important that you get all the data back from such a drive.

So, here, you can try USB Flash Drive Recovery Tool to restore lost data from USB flash drives. The best thing about this flash drive recovery software is that it is available for both Windows and Mac computer.

With the help of this photo recovery software, one can:

  • Easily get back inaccessible or lost pictures, videos, and audio files from corrupted USB flash drive
  • Recover digital media files from corrupted pen drive, SD card, memory stick, hard drive, camera card
  • Also retrieve media files from unreadable, damaged, write-protected, or unrecognized USB flash drive
  • 100% read-only. Safe, secure, and easy to use

So, without any delay just download and install this software on your PC and recover data after solving how to repair corrupted flash drive using CMD (Command Prompt).

Download Data Recovery For Windows Download Data Recovery For Mac
* Free version of the program only scans and previews recoverable objects.

Steps To Recover Files From Corrupted USB Flash Drive

Step 1: Select Desired Location

Firstly, select the drive, external media or volume from which you want to recover deleted media files. After selecting, click on 'Scan'.


Step 2: Preview Recovered Media Files

Next, you can preview the recoverable media files after the scanning process is completed.


Step 3: Recover Media Files

Lastly, you can select the images, audio, video files you want to restore and click on 'Recover' option to save them at the location you want.


Frequently Asked Questions:

How Can I Repair My USB Flash Drive?

Well, as mentioned above, you can follow the above command prompt (CMD) to repair corrupted USB flash drive, SD memory card, memory sticks. On the other hand, if you know that your USB flash got corrupted due to virus infection, then run an anti-virus tool to scan your corrupted flash drive
For detailed information please visit: Learn To Remove Virus From SD Card Without Formatting It (though it is mentioned SD card you can follow the same solution to remove virus from your virus-infected USB drive).

How Do I Remove Write Protection?

Many USB drives, memory stick, pen drive, SD card come with the feature of write-protection.
But sometimes it creates problems and when it creates a problem then users are not able to access files from write-protected USB flash drive, SD card, pen drive, etc.

How Do You Fix An Unrecognized USB?

Well, there are also many users out there, whose USB drive does not get detected or does not get recognized by the computer. In such a situation, they look for the solution on how to fix an unrecognized USB drive?
Well, if your USB drive, pen drive, SD card or external hard drive does not get recognized by your computer, then please follow the related links mentioned below and find out the best solution for your problems and get fixed your unrecognized USB/SD card or pen drive.

You Might Also Read: Fix I/O Device Error USB Flash Drive


I hope after going through this entire post, you must have got enough info regarding how to fix corrupted flash drive using cmd and how to recover corrupted files from USB using CMD.

This tutorial will definitely not let you down, so just try the solution with the step-by-step instructions mentioned above and solve how to fix corrupted USB using CMD. And, if you notice that the data you have saved in the flash drive has been lost the try USB Flash Drive Recovery Tool.

This tool will definitely help you restore files on corrupted thumb USB flash drive in no time. So, all the very best guys.