On Windows, you can simply right-click on the recycle bin icon and select the Empty Recycle Bin option to clear the bin. Alternatively, you also have the option to clear it on schedule. But, what if you are looking for a command to empty the recycle bin? Maybe you want to run the command in a script or as part of your scheduled maintenance. Whatever the reason, we’ll tell you the command and how to use it in this simple guide. Let’s get started.
Note: Be careful when deleting files from the Recycle Bin. Once deleted, you will not be able to recover them. So, double-check before proceeding.
Empty Recycle Bin Using CMD
As many of you may know, the Recycle Bin behaves similarly to a normal folder. However, contrary to what you see, Windows actually maintains separate Recycle Bin folders ($Recycle.Bin) for each drive. This means that when emptying the Recycle Bin from the command line, you have to clear it for each drive individually. When you compare it to the graphical approach, it’s a bit tedious but that’s how you should do it.
Start by clicking on the Windows logo on the taskbar to open the Start menu. Next, search for Command Prompt. From the search results, right-click on Command Prompt and select Run as Administrator.
In the terminal window, enter
rd /s /q <drive>:\$Recycle.Bin. Replace <drive> with the actual drive letter such as C. If you have multiple drives, execute the command for each drive individually.
For example, if you have multiple drives such as C:, D:, and E:, you’d run the command separately for each drive like this:
rd /s /q C:\$Recycle.Bin
rd /s /q D:\$Recycle.Bin
rd /s /q E:\$Recycle.Bin
Once you are done, close the terminal window. And there you have it. That’s the command to empty the recycle bin. I hope that helps.