How to Realize Windows File Recovery from Recycle Bin Using Command

Accidentally deleted files? Learn how to recover them using the Windows file recovery Recycle Bin command with step-by-step instructions! Plus, explore the best workaround to restore lost files in any situation.

By @Judy
Last Updated June 23, 2025

User Case

 

Recover deleted files from Recycle Bin using Command Prompt

I got a black screen after deleting files from the WindowsApps folder. Now I’m thinking about to recover those files using the command prompt in WinRE. If feasible, what commands should I enter at the prompt?

- Question from Microsoft Support

Why Execute Windows File Recovery from Recycle Bin Using Command?

Windows File Recovery Recycle Bin Command

Before diving into the solutions on how to recover deleted files from recycle bin using command prompt, let’s explore why you would even need to recover a file from Recycle Bin with CMD in the first place. Here are seven common scenarios

  • Accidental Deletion: You may accidentally delete the files that you need among stacks of useless files.
  • Recycle Bin Emptied Too Soon: Maybe you cleared the Recycle Bin to free up space, forgetting crucial documents were still in there.
  • File Not in Recycle Bin: You may permanently delete some files by pressing “Shift+Delete”, but the deleted files are not in the Bin.
  • Corrupted Recycle Bin: Sometimes, the Bin gets glitchy, and files disappear without warning.
  • System Crash: A sudden shutdown or system failure might make the Recycle Bin inaccessible.
  • Virus or Malware Attack: Malicious software can wipe out files, but command-line recovery might still retrieve them.
  • Need for Advanced Recovery: GUI tools might fail, making CMD the last resort for how to recover files from Windows Recycle Bin.

Windows Files Recovery from Recycle Bin Using Command

This part will give you 2 different ways to recover files from the Recycle Bin using commands. One way is for users whose Windows system can boot normally, and another way is for those whose Windows system cannot boot.

Scenario 1. Windows System Can Boot Normally

Sometimes, you can run the Windows system, but your Recycle Bin is not accessible. In this case, you can use commands to open the Recycle Bin and restore files from it.

Step 1. Search “cmd” in the Start menu and right-click Command Prompt to "Run as administrator" (Windows 11). Or, you can press "Win + X" and choose "Command Prompt(Admin)" to open it (Windows 10).

Open Command Prompt

Step 2. Type Start Shell:RecycleBinFolder and press “Enter” on your keyboard. Then, your Recycle Bin folder will pop up.

Open Recycle Bin Using Command

Step 3. Select the files you want to recover and right-click on them. Then, choose “Restore” to get the files back to the original location.

How to Recover Files from Windows Recycle Bin

Scenario 2. Windows System Cannot Boot

You may encounter the Windows system unbootable issue and want to use the Command Prompt to recover files in WinPE. Here are the steps to help you get there.

Step 1: Boot into WinRE (Windows Recovery Environment)

1. Insert the Windows installation USB/DVD and boot from it.

2. On the setup screen, click “Next”, then choose “Repair your computer” at the bottom left.

Choose Repair Your Computer

3. Choose "Troubleshoot" > “Advanced options” > “Command Prompt”.

Choose Troubleshoot

Step 2: Identify Drive Letters (Your Windows Partition and Backup Drive)

In WinRE, drive letters may be different from what they are in Windows. You can check with the commands:

diskpart

list volume

List Volume

Then, you can look for your Windows partition (usually labeled with OS or familiar size), and note the drive and your external hard drive’s letters. After knowing the drive letters, exit DiskPart by entering exit.

Step 3: Navigate and Copy Files with xcopy or robocopy

⇒ Use xcopy command:

xcopy D:\Users\YourUsername\Documents E:\Recovery\Documents /E /H /C /I

Explanation:✎...
D:\Users\YourUsername\Documents = source folder (adjust as needed)
E:\Recovery\Documents = target on external drive
/E = copy subfolders, including empty ones
/H = copy hidden and system files
/C = continue even if errors occur
/I = assume destination is a directory

⇒ Use robocopy command:

robocopy D:\Users\YourUsername\Documents E:\Recovery\Documents /MIR /R:1 /W:1

Explanation:✎...
/MIR = mirror directory structure
/R:1 = retry once on failure
/W:1 = wait 1 second between retries
Note: If you want to copy other files from Desktop or Downloads, replace Documents with Desktop or Downloads.

Step 4 (Optional): Back Up Entire User Folder

Enter:

robocopy D:\Users\YourUsername E:\Recovery\YourUsername /E /COPYALL /DCOPY:T

Explanation:✎...
/COPYALL = preserve all file attributes
/DCOPY:T = preserve timestamps

Best Workaround: Recover Deleted Files from Recycle Bin (Windows Can Boot or Not)

Is there an ultimate solution that can be used whether the Windows system can boot or not? Yes! MyRecover can help you realize it without effort! MyRecover is a data recovery software that can be utilized for over 500 scenarios, including permanently deleted files in the Recycle Bin, PC crash, formatting, and losing a partition. Besides, it supports 500+ devices so that you can use it to restore lost files in an internal hard drive, external hard drive, PC, SD card, or camera.

Step 1. Create Bootable Media (Optional)

If the Windows system cannot work on your computer:

1. Download and install MyRecover to an external hard drive from another device.

2. Choose PC Crashed Recovery and choose the external hard drive. Then, click “Create” and wait for the task to be finished.

Create a Boot Device
⚠️Note: Before creating a boot device, your external hard drive will be formatted.

3. Insert the boot device into the crashed computer. Then, enter the BIOS system and select the device to boot the computer.

Enter the BIOS System

Step 2. Perform Windows File Recovery

1. Scan the disk where you want to restore files from.

Scan the Disk

2. Select the desired files and click “Recover”. If you want to preview the files before recovering, you can use the MyRecover Professional Edition, which also supports restoring unlimited files instead of 500MB for free.

Select Files to Recover

3. Choose the location to save the restored files. Then, wait for the task to succeed. There will be a pop-up window to notify you.

Recover Files Successfully

Conclusion

This post separately shows you 2 methods of Windows file recovery from Recycle Bin using commands in terms of different scenarios. Whether your Windows system can boot or not, you can find the specific steps for data recovery. Besides, there is a more versatile way that can restore data under any scenario – using MyRecover. It provides various functions that you can choose to deal with your data loss issue, like how to recover deleted files from Recycle Bin after emptying it, with easy operations.