


How to Schedule Windows to Empty Recycle Bin Automatically - Make Tech Easier
May 18, 2025 am 12:13 AMWhen using Windows, whenever you press the Delete key on the keyboard, the system moves the file from its original location to the Recycle Bin. This operation is designed to easily recover if you accidentally delete files. However, if not managed, the number of files in the recycling bin will gradually increase over time. However, you can set up the recycling bin to automatically clear it regularly so you don't have to remember to clean it yourself. This article will show you how to set Windows to automatically clear the Recycle Bin periodically.
Table of contents
- Automatically clear the recycling bin using the task scheduler
- Automatically clear the recycling bin when closed
- Automatically clear the recycling bin using storage awareness
- Frequently Asked Questions
Automatically clear the recycling bin using the task scheduler
Task Scheduler is a built-in application in Windows that helps you automate tedious tasks. You can even set it up to clear the Recycle Bin periodically. The following are the steps:
- Enter "Task Scheduler" in Windows Search and click the Best Match. Alternatively, you can also open the task scheduler by running (press Win R to open the dialog box) command taskschd.msc.
- After opening the Task Scheduler, click the "Create Basic Task" option under the "Operations" category on the right panel.
- This opens the Task Creation Wizard. Enter the name and description you selected here, and then click "Next" to continue.
- You can set the time interval for the task to start. For example, select the Weekly radio button and click Next.
- Select the start time and repeating day of the week and click Next. In this example, we chose a repetitive Sunday, which means the task will run at 2:53 pm every Sunday.
- In the next window, select the Start Program radio button and click Next.
- Enter "cmd.exe" in the "Program/Script" field and enter the following command in the "Add Parameter" field. When done, it will look like this:
<code>/c "echo Y|PowerShell.exe -NoProfile -Command Clear-RecycleBin"</code>
- Now, review all the settings you just configured and click the "Finish" button to complete the task creation process.
- Select a task in the main window, and then click the Run option under the Selected Project category to test the scheduled task.
- Once you click on the option, if everything goes well, you will see a command prompt flashing quickly and your recycle bin will be emptied.
- From now on, your recycle bin will automatically clear based on the triggers you set in the task scheduler.
- It should be noted that this approach (and others described in this article) will cause files in the Recycle Bin to be permanently deleted. That is, it is possible to recover permanently deleted files, but it is not guaranteed, especially when using SSD.
Tip : Check out these useful tasks that you can use the task scheduler to schedule.
Automatically clear the recycling bin when closed
While using the task scheduler method is sufficient, some users may be looking for a conditional trigger rather than a time trigger. One of the most effective ways is to automatically clear the recycling bin every time you shut down your computer. We can have Windows start it automatically by creating a simple .BAT file and modifying the Group Policy Editor.
- We will first create a batch (.BAT) file using Windows built-in Notepad. Enter "Notepad" in Windows Search and click below to launch it.
- Copy the following code into the text file in Notepad:
<code>PowerShell.exe -NoProfile <br>-Command Clear-RecycleBin <br>-Confirm:$false</code>
- Click "File->Save As".
- Under Save Type, select All Files. Finally, name the file "EmptyRecycleBin.bat" and save it to your favorite location.
- Now you have a batch file that can clear the Recycle Bin every time it starts. You can try it now - double-click it and check your recycle bin! It should be empty.
- Next, we need to instruct Windows to automatically start this batch file when it is closed. This can be done through the local Group Policy Editor. Press Win R to open the Run dialog box and enter gpedit.msc.
Note : If you are using Windows Home, you need to enable the Group Policy Editor first. How to do it here.
- Navigate to the following path: "Computer Configuration -> Windows Settings -> Scripts (Start/Close) -> Close".
- Double-click the Close script, then select Add and click Browse.
- Find the .BAT file and select it.
In the Local Group Policy Editor window, click OK to save.
Now, Windows should start this .BAT file when you shut down your computer.
How to disable automatic clearing of recycle bins when closed
Disabling this feature is very simple, you just need to delete the script we created earlier.
- Start the local Group Policy Editor and navigate to the Scripts (Start/Close) section again.
- Double-click the "Close" option and you will find the script we set up before.
- Click it once to select it, and then click the “Delete” button on the right. Finally, click OK to save.
Tip : Check out the best tools to completely delete files from your Windows system.
Automatically clear the recycling bin using storage awareness
Storage Awareness is a feature available in the new version of Windows that allows you to free up storage space. You can also use it to enable Windows to permanently delete files and folders in the Recycle Bin after a certain period of time.
- Press Win I to quickly start Windows settings.
- Navigate to System->Storage.
- If Storage Awareness is not enabled, enable it and click it to view all options.
- Find the "If files in the Recycle Bin already exist more than" option and click below to view the drop-down menu.
- You can choose the time range that suits you, from 1 day to 60 days, or choose "Never".
Tip : Can't delete files from Windows PC? Here is how to force delete files that cannot be deleted on Windows.
Frequently Asked Questions
Can I disable the Recycle Bin?
Yes, you can right-click on the Recycle Bin and select "Properties". Then you can check the option "Don't move to the recycling bin when deleting files, delete files directly". Doing so will close the Recycle Bin and every file you delete will be permanently deleted. Be careful when disabling the Recycle Bin.
Can I hide the recycling bin?
Yes, press Win I to open the Settings app and navigate to "Personalization->Theme". Then, scroll down until you see the "Desktop Icon Settings" option, click it. A new window will open, from where you can select the default icons you want to see on your desktop, including Recycle Bin, this computer, network, etc.
Image source: Flaticon, Flaticon 2. Screenshots courtesy of Mustafa Ashour and Vamsi Krishna
The above is the detailed content of How to Schedule Windows to Empty Recycle Bin Automatically - Make Tech Easier. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Fully wireless speakers, like the Anker Soundcore 2, can be a reasonable choice to pair with phones and laptops. They can usually draw power via USB, which allows them to be used wired. However, their limited power output also means that they don't g

It also fully integrates with the right-click context menu on Windows 11, so you can carry out basic tasks—such as adding a file to an archive or extracting the contents of a ZIP file—without needing to open the application itself.NanaZip also provid

In many ways, it doesn’t make sense for me to use wireless keyboards with my stationary PC. Not only do my keyboards never move, but I tend to keep the 2.4 GHz receiver sitting on my desk via a dongle attached to a cable. Further, my keyboard needs r

Opening Reliability Monitor on Windows 11 Microsoft has buried this useful utility a few clicks deep, but it's simple to reach if you know the steps. The simplest way to access the Reliability Monitor is through the Start menu search bar.Start Menu S

The New Microsoft Edit Is Superb There isn’t much to say about Microsoft Edit, and that’s a great thing. It has quickly become my preferred tool for quick text editing thanks to its straightforward nature.A Minimal InterfaceThe interface is as simpl

The JLab Flow Mouse & Keyboard Bundle is a fantastic, budget-friendly mouse and keyboard combo. It’s not the most advanced setup in the world, nor the quietest, but I admittedly had a hard time going back to my daily drive PC accessories when I f

PC gamers have been dealing with these issues for decades now, as Windows has been and remains the default operating system for PC gamers. However, thanks to Valve and SteamOS, as well as other gaming-centric Linux distributions like Bazzite, Microso

Microsoft has made changes to almost every part of Windows 11 since its initial launch in 2021, but the taskbar and Start menu have remained largely untouched—until now. A fresh Start menu design is on the horizon, and it might be one you prefer.This
