How to Fix a Corrupted Pen Drive or SD card using Command Prompt?

Has your Pen Drive or SD card stopped working suddenly? Are you tired of formatting it again and again? And still your storage devices continue to malfunction.

Most of you might have faced this problem with your Pen Drives and SD cards. If yes, then we are here to help you solve this problem and fix your corrupted USB drive.

We can repair a corrupted pendrive or SD card using Command Prompt in windows. This How to guide will help you do that in a simpler way. In this technique all you need is to enter some commands in command prompt and windows will forcefully format your corrupted pen drive or SD card.

Follow this simple steps and you can do that in just a few minutes.


Connect the corrupted pen drive or SD card to your computer.


Now open Command window. You can actually do this in several ways. Press Windows Key+R and type cmd in the dialog box and click on OK. This will let you open command window. Also you can click on start button and type cmd in search box and select the command prompt program.


Once done with opening the command prompt window, its time to enter some commands into it.

Type diskpart and press Enter.

Diskpart command window

Diskpart command window

Next type list disk and press Enter. This will display a list of all the storage devices connected to your computer.


Now type select disk <the number of your disk> and press Enter. Here the number of your disk is the number assigned to your removable storage.

Recommended:  A guide to pick the best ELD provider

Note: Make sure you enter the number correctly. Otherwise, you may format your internal hard drive.


After selecting the disk accurately, type clean and press Enter. Next type create partition primary and hit Enter.


Now type active, and press Enter.

Type select partition 1, and hit Enter.


Finally, type format fs=fat32 and hit Enter. You can write ntfs instead of fat32 to format drives larger than 4 GB.The format process will complete in a few minutes. Do not close the window untill the process is done.
Here is the entire process.

Diskpart final image.jpeg

Diskpart final list of commands

Once done your USB drive is back to normal again.

If you have faced any problems or need help then please let us know through comments. Don’t forget to share this article.

For more such How to’s Follow us on Facebook, Twitter and Google+.

Was this post helpful?


We Curate Best Tech Stories For You!

You may also like...

10 Responses

  1. heri says:

    How to repair, ,pen drive , status no media , ,can help me…

  2. Andre says:

    There is to fix my hard drive it has got Raw has a file system…if there is a way to fix this please tell me

  3. pathuahir says:

    how to format my hp pen drive the write protected in the error

  4. Unnat says:

    hi…i am stuck at step 5…cant create partition primary after clean . it says

    No usable free extent could be found. It may be that there is insufficient
    free space to create a partition at the specified size and offset. Specify
    different size and offset values or don’t specify either to create the
    maximum sized partition. It may be that the disk is partitioned using the MBR disk
    partitioning format and the disk contains either 4 primary partitions, (no
    more partitions may be created), or 3 primary partitions and one extended
    partition, (only logical drives may be created).

    Please help

  5. Umakanth says:

    Hi i performed above steps but i am facing “Diskpart has encountered an error: Access Denied” . Could you please help us how to resolve the issue in such cases.. Thanks in advance.

  6. Sam says:

    After trying lots of different 3rd party software without success, I am happy to report that this method completely repaired my 16GB MicroSD Card. Before repairing using this method, the card was totally unreadable by windows, was unable to format it using the common windows method, and EaseUS Partition Master reported that the SD card had about 30% bad sectors.

    Don’t bother trying to use third-party recovery software, use this CMD prompt method, it took about 20mins to complete, and it totally repaired my screwed up MicroSD card.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

How to Fix a Corrupted Pen Drive or SD card using Command Prompt?

by CuriousPost time to read: 2 min