Empty Recycle bin from command line

by admin on May 17, 2011

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

{ 1 comment… read it below or add one }

pat July 20, 2012 at 3:26 am

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

Reply

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: