Recover Files from USB Using CMD attrib | CMD Recovery - Qiling  

Command Prompt for USB Recovery: Recover Files Using CMD


PAGE CONTENT:
How to recover files from USB using CMD attrib and other command lines
How to recover permanently deleted files from USB with data recovery software

Overview of Command Prompt for USB Data Recovery

Command Prompt, being as one of the handy Windows built-in utilities that enable users to take full control of your computer, could do you a favor in retrieving files after hiding, accidental deletion, corrupting, or virus infection. You can recover deleted or corrupted files from a computer hard disk, USB flash drive, pen drive, memory card, or other external hard drives using CMD.

Compared with professional data recovery software , the command prompt for data recovery has the following advantages and disadvantages.

Advantages:

Disadvantages:

Read this post and learn how to recover files from USB using CMD attrib to retrieve hidden files, or use other command lines to recover data from a pen drive or hard disk. What's more, you can use Deep Data Recovery to recover files from USB when the CMD fails.

How to Recover Files Using CMD

In the following, you're going to learn all data recovery command lines that are available to use in some specific situations, including recover files from virus infected hard drive, recover files from corrupted drive with bad sectors and recover inaccessible files from the RAW drive.

Notice:
Command prompt's ability in recovering deleted files is restricted to a large extent, which means that you may not be able to fully restore every lost file by using CMD. 
Be careful when you are using the command lines. A tiny wrong type can cause serious results.

1. Recover Files from USB Using CMD Attrib

Applicable to: Deleted, lost, hidden and even virus-infected files recovery

Supported devices: Windows hard drive, external HDD, USB, SD card, etc. storage devices

Attrib command only enables you to recover hidden files. If your files disappeared somehow, you could use the attrib command to check whether the file is hidden by unintentional operation or virus infection. For other data loss cases, such as formatting, partition turning RAW, or files being deleting, the attrib command won't work.

Step 1. Plugin your hard drive, memory card, or USB drive to your computer.

Step 2. Go to the start menu, type in "cmd" in a search bar, hit Enter. Then you can see something named "cmd. exe" under a list of programs.

type cmd and open command prompt in Windows

Step 3. Right-click "cmd. exe" and then you will get the command windows that allow you to recover virus-infected files.

Type in "attrib -h -r -s drive letter:\*.* /s /d", for example, "attrib -h -r -s G:\*.* /s /d".

(Replace G with the drive letter of your hard drive or external storage device where you lost files.)

recover virus infected files with attrib command

2. Recover Deleted Files from Recycle Bin Using Command Prompt

Applicable to: Deleted file recovery, recycle bin file recovery

Supported devices: Windows hard drive, Desktop 

If you deleted files to the Recycle Bin, you can either choose to right-click files in the Recycle Bin or follow the command lines to restore them to the original location before emptying it.

Note: The command line can only recover files that are still in the recycle bin, not files that are not in the recycle bin or on the hard drive. If you want to recover files from an emptied recycle bin, here are the tutorials. 

Step 1. Go to the start menu, type: cmd in a search bar, and hit Enter. Click "cmd. exe" under a list of programs to open the command prompt.

Step 2. Type: start shell:RecycleBinFolder and press Enter. 

Step 3. Select the files to restore.

recover files using chkdsk command

3. Recover Files from RAW Drive Using chkdsk and rescan Command

Applicable to: RAW file system or corrupted file system recovery

Supported devices: RAW drive, inaccessible external HDD/USB/SD

If you lost files on external storage devices, connect to your computer in advance and open the command prompt in Windows. Log in with your administrator account and password if necessary.

Step 1. On the command window, type chkdsk drive letter: /r/f (e.g., chkdsk d: /r/f) and hit Enter. (Replace with the drive letter of your storage device where you lost files.)

recover files using chkdsk command

Step 2. On the command prompt window, type diskpart, and then hit on Enter.

Step 3. Type rescan and then hit enter.

recover files using diskpart command

Step 4. Exit DiskPart, type chkdsk /f d: in CMD and hit Enter. (Replace with the drive letter of your storage device where you lost data.)

Wait for the process complete, and you can check the device to see if your lost files have been restored. If you didn't restore lost files using the above command prompt, or you need to get back files from more complex situations, such as recover data from lost partition in Windows 10/8/7, Deep Data Recovery with advanced features introduced below can help you figure out. 

How to Recover Files from USB Using the Best CMD Alternative

Since the command prompt is incapable of retrieving files under many circumstances, like restore data from dead computer hard drive, unformat hard drive, emptied recycle bin recovery, and so son, you need a CMD alternative for USB file recovery.

Deep Data Recovery can fully replace command prompt and allows you to:

To recover files from USB or pen drive without CMD, do as follows.

Step 1. Select file types and click "Next" to start

Launch Deep Data Recovery. Select file types and click "Next" to start.

Select file types that you want to recover

Step 2. Select a drive and start scanning

Hover over the partition where you lost data. This could be an internal hard disk, external disk, USB, or SD card. Then, click "Scan".

select a location to scan

Step 3. Check and preview scanned files

Use the file format filter on the left or upper right corner to narrow the scan results until you find the files you need. Then, you can click the "Preview" button or double-click a file to preview its content, if you'd like. 

Recover lost files

Step 4. Recover lost data to a secure location

Click the checkbox next to the file and click "Recover" to restore the lost data to a secure place. We recommend that you do not store the recovered data on the disk where you lost it earlier.

Final Verdict

This post covers all the command lines to recover hidden files, restore data from the recycle bin, and retrieve files from RAW partition. Follow the examples and be careful. Wrong command lines can make your data loss worse.

Deep Data Recovery is an easy-to-use file recovery tool that allows you to recover deleted or lost files with a few clicks. If you are a computer beginner and don't know how to use command prompt to recover files from USB, we highly recommend you try this simple data recovery software.  

Recover Files from USB Using CMD Attrib FAQ

The following are the highly relevant questions about how to recover files using CMD. Check the brief explanations if you also have any of these problems.

What is attrib command in CMD?

The attrib command allows an MS-DOS and Windows command line user to change the attributes of a file or folder. For example, you could recover hidden files using the attrib command. The attrib command is available in the Command Prompt in all Windows operating systems including Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, and other older versions of Windows.

How can I recover files from a corrupted USB?

Is your USB corrupted? How to recover and open files on a corrupted USB drive? Use Qiling data recovery program to recover files from corrupted, damaged or formatted HDD, SDD, USB flash drive, external hard drive, Pen drive, SD card, CF card, etc..

Step 1. Connect the corrupted USB flash drive to your computer and launch Qiling USB data recovery software on your PC.

Step 2. Select your USB drive, which marks as a removable disk, and click "Scan" to start finding your files.

Step 3. Preview and recover all the files from corrupted USB.

How do you attrib a flash drive using command prompt?

Follow these steps to recover files from USB flash drive using CMD attrib:

Step 1. Right-click Windows icon and type cmd in the search bar.

Step 2. Select to run Command Prompt as Administrator. Sign in with your administrator account if necessary.

Step 3. Type: attrib -h -r -s G:\*.* /s /d (Replace G with the drive letter where you'd like to show hidden files) and hit Enter.

How do you use CMD to recover lost or deleted files?

You can use the attrib command to recover hidden files from a storage drive like hard drives, flash drives, USB. etc. You can follow these commands in the command prompt and easily retrieve deleted files from Windows 10, 8, 7:

Step 1. Press Windows + R key together in a search box, type CMD.

Step 2. In Command Prompt window, type chkdsk drive letter /f and press Enter. ( e.g.: chkdsk D : /f)

Step 3. Press Y 'Yes' until the command lines start again Again. Enter the drive letter and click Enter.

Step 3. Type drive letter and press Enter.

Step 4. Type /f --> attrib -h -r -s G:\*.* /s /d. This command will recover all hidden files in a storage device.

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!