How to Empty Recycle Bin from Command Line

Ever wondered how one can empty the recycle bin using Windows Command line (CMD) ?Majority of the time, we manually clear the recycle bin using right click over it. But, if you want to know more quicker ways or wish to impress your friends ? you certainly wanna dig into to this post (written by my college friend) on how to delete all the files and directories on permanent basis from recycle bin.

command to clear recycle bin

Follow below command to execute the program:

  • Press Windows+R button
  • Type CMD and hit Enter button
  • Type rd /s %systemdrive%\$Recycle.bin and hit Enter
  • Type Y and hit Enter

Command line to empty the recycle bin

Although it will show message that ‘Access is denied’ but nothing to worry, your recycle bin has been cleared successfully. You can cross check by double clicking on Recycle Bin. This command works on all Windows operating system from 10 to XP.

Let’s go a bit in detail.

The RD function is to removes empty directories and /S powershell commands is to execute it on Windows XP and above version.

Other Options?clean recycle bin image

Cleanmgr – This is very old method which was mostly used in Windows 98 and XP. But this is useful tool which still works with Windows OS. It’s basically Disk Cleanup utility which allow user to remove temporary files and trash items from recycle bin.

  • Press Windows+R and press Enter
  • Type Cleanmgr and press Enter
  • Select Drive from drop down menu
  • Let it calculate estimated junk files stored on system
  • Disk Cleanup tab open, select directories from the list and click on ‘Clean up System Files
    Disk cleanup for windows
  • Click on OK
    Confirm to delete files

Voila ! All the files have been cleared from your system.

Using Command Line (CMD)

Same above step you can perform using  command prompt. For this you have to follow two steps:

  • Press Windows+R, type CMD and hit Enter
  • Type cleanmgr /sagerun:1 and hit Enter

This will automatically clean all temp and junk files from your system.

You might also like check how to check system information using command line.

Pro Tip

Type below command line and it will wipe out all junk files from recycle bin without asking for any confirmation.

start del /s /q %systemdrive%\$Recycle.bin

The best part about these command line is that it can be used to empty the recycle bin in leading Windows OS like 10, 8, 7 and even XP as well.

Did you know?

Recycle bin is also called as ‘Trash’ and clearing the recycle bin is the only way to permanently delete the files from system as recycle bin collects all the files which are deleted (more correctly  ‘temporarily deleted’) from the system.



Founder and Writer @ WinOSBite. Future plan is to make this platform open to community to resolve and discuss various issues, usage related to Operating System.

Leave a Reply

Your email address will not be published. Required fields are marked *