Empty Recycle Bin of multiple accounts (Command Line)

empty_recycle_bin_all_thumb.png

Some people share a PC with multiple users, and each user has it’s own mess of files. They also have separate Recycle Bin’s. When a user deletes a lot of stuff, it sits in the Recycle Bin until it is emptied. Some users don’t know that you need to empty the bin occasionally. Here is a quick command line tip to empty all the Recycle Bin’s on your PC – without having to log into the other users accounts. This could also be scripted if you want to have the Recycle Bin emptied when logging in or off, if you wish.

1. Launch the Command Prompt as an Administrator. Start > All Programs > Accessories > Command Prompt (you can press Right Shift and left click the shortcut and select Run as different user, if needed).

2. Type in rd /s c:\$Recycle.Bin and select Y to delete all the files in the Recycle Bin.

empty_recycle_bin_all

The first window is not using an elevated CMD prompt, the second is using Run as different user as Administrator.

This can help you keep your PC clean and stop your hard drive from filling up completely if you have a user that forgets to empty the Recycle Bin!

Dustin is the Head Editor of MSTechPages and has been awarded the 2011 Microsoft Community Contributor award. He is in the process of finishing up a book about Windows 7 Tips and Tweaks. Also, a free ebook for Windows 8 keyboard shortcuts is available on this site, with more printable "cheat sheets" coming soon. You can also find him in the Microsoft Community forums (also as a Community Moderator), Tech Support Guy forums, HardForum, and The Windows Club forums, among several others.
Dustin
View all posts by Dustin
Dustins website
You can leave a response, or trackback from your own site.
  • Guest

    you should detail what each part of the syntax means.

    • John

      If you don’t know how to find out with a  simple /? switch, you honestly probably shouldn’t be using this ;)

      But…
       rd=removes(deletes) a directory
      /S= removes all dir and files in the specified dir + the dir itself
      /Q= quiet

  • Brave_Windows_User

    Bug #1: The RD command doesn’t work AT ALL on the Recycle bin… unless you first change its attributes. (The author “tested” his cmd on a bin that has already been correctly changed. And he wonders why it doesn’t work for anyone else)

    Bug #2: You can have bins on *ANY* drive and *ANY* partition on that drive. Never always assume everyone in the world has only 1 drive… with only 1 partition called C, on that drive. (I have 4 drives, each with 4 partitions. 16 total.)