≡ 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 there is no command for cleaning up recycle bin. Also recycle bin is not a folder like all other folders. I have no idea where the items in the recycle bin really get stored. Otherwise, running del command on that folder would have worked.  Finally I got a solution by using cleanmgr utility.

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

{ 3 comments… add one }
  • pat July 20, 2012, 3:26 am

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

  • Anonymous October 14, 2015, 4:52 pm

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

    • admin October 14, 2015, 10:14 pm

      Awesome, That works.

Leave a Comment