How To Empty the Recycle Bin Automatically on Windows 10

Tired of cleaning up the Recycle Bin manually on your Windows desktop? Here is a pretty cool tip to automate this process. Thanks to Winaero for sharing it.

Command used to empty the bin

You can use either Windows command-line like this

rd /s %systemdrive%\$Recycle.bin

or PowerShell cmdlet like below.

Clear-RecycleBin

windows-powershell-clear-recyclebin

Since the Windows command needs local admin privilege to run and needs to specify the location of the Recycle bin to run, we will just use the PowerShell cmdlet in this case.

To empty during startup

Open Startup folder by launching the following shell command in the Run dialog box.

shell:startup

run-shell-startup

And right-click inside the folder to create a new shortcut named “Empty Recycle Bin” with the following command in the Target box.

cmd.exe /c "echo Y|PowerShell.exe -NoProfile -Command Clear-RecycleBin"

 

create-shortcut-empty-recycle-bin

That’s it. The recycle bin will be emptied out every time you log into your computer.

Behind the scene, what it does is to call out the Command Prompt to launch PowerShell to execute the cmdlet Clear-RecycleBin with an Echo Y to answer Y to the prompt. Pretty simple and clever.

Note that the command mentioned above will remove all files and folders currently in the Recycle Bin from all user accounts regardless of the physical location of the recycle bin.

To schedule a job

If doing so during the Startup isn’t your option, you can use Windows built-in Task Scheduler to make a more flexible task to do the job.

Open Task Scheduler, start to create a  new task in Task Scheduler Library.

First of all, give a name in General tab. In this case, we can call it as “Empty Recycle Bin.”

Then, create a trigger of your choice in Triggers tab. There are a lot of options to choose from.

task-scheduler-a-new-trigger

Then create a new action in Actions tab, put “cmd.exe” in Program/script box and the following command in “Add arguments” box.

/c "echo Y|PowerShell.exe -NoProfile -Command Clear-RecycleBin"

new-action-2016-09-12-23_00_36

Click OK to save the setting. And it’s done.

Kent Chen

Microsoft MVP, IT Professional, Developer, Geek, and the co-founder of Next of Windows.

Last updated: 09/12/2016

Posted in: Tips & Tricks
Discover more: , ,

Leave a Reply

Notify of
avatar
wpDiscuz
Today's Top Picks for Our Readers:
Recommended by Recommended by NetLine