6 Ways to Recover Data from Flash Drive with CMD

The Question: Is it able to recover data from flash drive with cmd? Can we repair damaged flash drive without software?

recommendWe would recommend 12 free flash drive recovery software for flash drive recovery instead of cmd.

Urgent Note

Here are some tips for making the best chance of usb flash drive data recovery.

  • Stop using your flash drive, we won't recommend you use cmd as the first rescue method to get data back, some readonly recovery free tool may help, such as iCare Recovery Free (100% free)
  • Avoid repairing it before files were restored
  • Disconnect your flash drive from the device to avoid using it as data storage

recommendDownload safe, read-only 12 free flash drive recovery software to get data back instead of using cmd for flash drive recovery.

If the above 12 tools cannot help, or if you insist on using cmd for the recovery, be free to follow the guide below that includes video guide for the flash drive recovery.

usb drive recoveryPart 1 - Recovering files from usb pen drive using CMD

Way 1 - attrib -h -r -s /s /d *.*

  • Connect flash drive to a Windows computer, Windows 11/10/8/7 is recommended
  • Launch cmd by using Windows icon + R on your keyboard (There are many other ways to start cmd that you may search it on Google.com)
  • Type the volume letter of your flash drive in your computer
  • Type attrib -h -r -s /s /d *.*, press Enter. (if you did not type the drive letter in the ahead step, you may use  attrib -h -r -s /s /d f:*.* at this step when f is the drive letter of your flash drive, replace f with your own drive letter)

cmd pen drive recoveryRecover files from flash drive using cmd in Windows 10

Video - How to recover files from flash drive using cmd

What do these parameters in attrib command mean?

  1. -h: it gives the Hidden attribute to the files specified.
  2. -r: it refers to the read-only attribute (files can be read but cannot be changed).
  3. -s: it gives the System attribute to the files specified.
  4. /s: it tells the system to search the specified path (including subfolders).
  5. /d: it consists of process folders.

Way 2: attrib -r -a -s -h /s /d

  • Open cmd
  • Connect your flash drive to computer
  • Typle 'f' when f is your flash drive letter that you need to replace it with your own drive letter that your flash drive appears in your computer
  • Type ' attrib -r -a -s -h /s /d'

Video - how to recover deleted files from flash drive using attrib

Way 3 - recover + file name.type

The following photo shows the way to recover deleted or formatted files from flash drive using cmd with just simple steps.

  • Open cmd and type the flash drive volume number/letter with a colon such as "f:"
  • Type 'recover 437615.jpg' as an example to recover image named 437615.jpg with its file type .jpg (You are required to give the exact name and file type for this recovery)

Tips: Cannot remember all file names and need to recover files in bulk? Turn to the flash drive recovery software mentioned later on this page for help.

unformat sd card using cmd recover

Complicated and hard to handle the cmd? recommendOur recommendation -> 12 free flash drive recovery software free download

Option: Professional flash drive recovery software needed? Try iCare Pro Free which is able to help recovering files from flash drive with best file recovery. (1GB totally free recovery, free code is also available for review request)

Part 2 - Repair damaged flash drive using cmd

Fixing damaged flash drive using cmd is possible and you may follow the following steps.

You may check its drive letter by going to your computer and see what drive letter your flash drive is displayed there.

Way 4 - chkdsk *:/f (* is drive letter that shall be replaced by your own)

chkdsk h: /f - (You need to replace h with your own flash drive's drive letter)

cmd chkdskk to repair sd cardcmd chkdsk to repair usb drive

Video Guide - how to repair corrupted usb drive using cmd chkdsk

Part 3 - Format corrputed flash drive using cmd

Way 5 - format fs=ntfs quick

cmd to format samsung sd

When most flash drive errors could be fixed in this cmd 'format fs=ntfs quick', you may reply on this cmd for fixing damaged usb flash drives when you have rescued data from flash drive in the first part of this article.

Is it able to Recover Flash Drive from Virus?

Way 6 - Recover files hidden by virus from usb

The following video would show you a video about how to recover virus infected flash drive.

Also read: how to recover data after virus from pen drive

Recommend: This page shares details about CMD for data recovery in different data loss situations: Data recovery with command prompt>>

Common Data Losses on your flash drive

What happened to your flash drive? Are your data important to you? Can you recover data from flash drive by yourselft without sending it to a service center?

Here are some common flash drive data losses that you may run into these cases including

  • Deleted files on flash drive by accident, flash drive files did not go to a recycle bin
  • Thrid party software failure that brought damages to your flash drive
  • USB port problem caused by power failure or software damages
  • Hardware failure
  • Overheated
  • Malware damages
  • Other logical or physical damages, improper use

Hot Articles

Related Articles

External Resource

Data Recovery Software Free Download > Pen Drive Recovery Software > How to Recover Data from USB Pen Drive Using Command Line