≡ Menu

Empty Recycle bin from command line

Recently I faced a situation where I had to empty the recycle bin from Windows command line(CMD).  After doing some search on this topic, I found that recycle bin is located on root folder of system drive. We can execute below command to clear all files and folders from recycle bin.

rmdir /s %systemdrive%\$Recycle.bin

To make it work we need to ruun command from elevated admin command prompt. Otherwise it throws error like below.

C:\Users\user1>rd /s %systemdrive%\$Recycle.bin
C:\$Recycle.bin, Are you sure (Y/N)? y
C:\$Recycle.bin\S-1-5-18 - Access is denied.
C:\$Recycle.bin\S-1-5-~1 - Access is denied.
Access is denied.

Alternative option

Cleanmgr is a GUI based utility but it has two interesting options /sageset and /sagerun. Using these two options we can clean up recycle bin from command prompt.  You can find the steps below.

  • First run the command ‘cleanmgr /sageset:1‘ either from command prompt or from Run window.
  • Now in the clean manager window select Recycle bin and unselect every other category.
  • Click on OK.
  • Now onwards whenever you want to empty recycle bin, you can simply run the command ‘cleanmgr /sagerun:1‘ from windows command prompt.

Related Posts:

Windows 8 does not ask for file deletion confirmation

8 comments… add one
  • pat

    What about this:
    rd /s %systemdrive%\$Recycle.bin

  • Anonymous

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

    • admin

      Awesome, That works.

    • Nandan


  • Steph

    Worked like a charm, thanks !

  • khgsdgf7

    works great thx

  • Rens

    I had a recycling bin contained millions of files, and used this code which worked perfect:
    del /s /q %systemdrive%\$Recycle.bin

    As the the author advices, first open an elevated command prompt. This instruction was very useful:

  • neha

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

    the above command is it delete files from recycle bin or everything fromC drive

Cancel reply

Leave a Comment