This is a collection of cmds for repairing damaged flash drive using command prompt chkdsk or diskpart.
We say usually we would recommend users fix damaged pen drive with free repair tools other than the cmd since mostly the free flash drive repair tools are easier to manage with simple user interface even for non-techie users to get the errors and problems fixed on flash drive.
Here are the exact command lines that you may use for fixing damaged pen drive if you insist on using cmd to get the repair job done.
CMD 1 - Fix corrupted pen drive with cmd chkdsk /f
Open your computer, connect your flash drive to your PC, and then remember its drive letter since it would be used in cmd chkdsk
chkdsk h*: /f
(* h is drive letter that you need to change to your own usb flash drive drive letter)
cmd chkdsk to repair pen drive
CMD 2 - Fix corrupted pen drive with cmd chkdsk /f /r
chkdsk /f/r i:
This time, you may use another cmd chkdsk /f/r i: when i is the drive letter that you need to replace it with your own flash drive drive letter.
CMD 3 - Fix corrupted pen drive with cmd diskpart format command
This one works for most damaged pen drives when it has raw format, unreadable error, flash drive 0 bytes...
Note: if your flash drive was infected by virus, you may undelete files from flash drive after virus using cmd.
What is Diskpart
Diskpart is a Windows command line that is built with many functions including cleaning disk information, formatting disk file system, changing properties...
See more professional information about diskpart on Microsoft.com
What is CHKDSK
CHKDSK (pronounced check disk) is a command that displays a status report for a volume, such as a disk/flash drive with main function to correct any errors found in that storage device.
The cmd command lines are advanced computing knowledge for advanced users. There could be some minor errors happen to non-techie users, for example you may wonder whether there should be any space among letters or should it need any : in between...
It's easy to get lost when using the cmd for starters so we strongly recommend users use free usb repair utilities instead of the cmd for repairing damaged flash drives.