How to repair flash drive through CMD command prompt in Windows

How to repair flash drive through CMD command prompt in Windows

In this article, we will learn how to format a USB flash drive using CMD in Windows 10 that is write protected, corrupted, unreadable, or not recognized by the PC. 

If you get any errors while formatting the drive or if the drive fails to show up in File Explorer even after you assign it a drive letter, you can use the Command Prompt to format the USB drive.
Important: Formatting a USB drive will erase all the data on it and if the data is important, you should move it all to a safe place before proceeding with the following steps. 

Step 1: Run Command Prompt as administrator. To do this, type CMD in the Start/taskbar search box, then right-click on the Command Prompt entry in the search results, then click Run as administrator. Then click Yes when you get the User Account Control screen to continue.
Step 2: In the Command Prompt, execute the following commands one by one.


Type the Diskpart command and press Enter.
The second command is to type List Disk and press Enter. Diskpart will display all the drives connected to the computer and also your internal drives. Then select the USB drive that you want to format and you should note its disk number. For example, as you can see in the following image, the USB drive disk number is 1. 

If you are not sure, disconnect the USB drive and run Diskpart in the disk command menu. When you do this, you can see the number of drives before and after connecting the USB drive.
3. Type the third command after selecting the flash drive and type the Clean command, then press Enter to start formatting the flash drive.
4. After completing the formatting process, type the Create partition primary command and press Enter to reset the flash drive again.
5. Type the Format fs=NTFS Quick command and this will format the drive using the NTFS file system. If you want to use the FAT32 file system instead of NTFS, use the fs=FAT32 Quick command.
6. Then type the Assign command to give the flash drive a letter.
7. We type the Exit command to close the window and the command prompt. 

google-playkhamsatmostaqltradent