sodcalculator

10 Tech How-To

Empty Recycle Bin Automatically in Windows 10

Guide 10-8275 · Updated · Step by step

This guide shows you how to make Windows 10 empty the Recycle Bin automatically on a schedule, so you never have to remember to do it manually. You’ll set up a simple task using the built-in Task Scheduler, and you can choose how often it runs (daily, weekly, etc.). No extra software is needed.

What You’ll Need

  • A Windows 10 PC with administrator access (to create the scheduled task).
  • About 10 minutes of time.

Step-by-Step

  1. Open Task Scheduler. Press Windows + R, type taskschd.msc, and press Enter. Alternatively, search for “Task Scheduler” in the Start menu.
  2. Create a new task. In the right-hand “Actions” pane, click Create Basic Task…. This opens a wizard.
  3. Name the task. Give it a clear name like “Auto Empty Recycle Bin” and a description if you like. Click Next.
  4. Set the trigger. Choose how often you want the bin emptied – e.g., Daily, Weekly, or Monthly. Click Next.
  5. Configure the schedule. Set the start date and time (e.g., every day at 3:00 AM). For weekly, pick the day(s). Click Next.
  6. Choose the action. Select Start a program and click Next.
  7. Enter the program and arguments. In the “Program/script” field, type cmd.exe. In the “Add arguments (optional)” field, paste exactly this:
    /c "echo Y|PowerShell -NoProfile -Command Clear-RecycleBin -Force"

    This command runs a PowerShell script that empties the Recycle Bin without asking for confirmation. Click Next.

  8. Finish the wizard. Review the summary and click Finish. The task is now created and will run at the scheduled time.
  9. Test it (optional). To make sure it works, right-click the task in the Task Scheduler Library and select Run. Check that the Recycle Bin is emptied.

Common Mistakes

  • Wrong command syntax. A missing space or a typo in the arguments will cause the task to fail silently. Copy the exact command from this guide.
  • Not using the -Force flag. Without -Force, PowerShell will prompt for confirmation, and since the task runs in the background, it will hang and never complete.
  • Task runs while the PC is off. If your PC is turned off at the scheduled time, the task won’t run. You can enable “Run task as soon as possible after a scheduled start is missed” in the task’s settings, but that’s not always reliable.
  • Using the wrong PowerShell command. Some older guides use rd /s /q C:\$Recycle.bin which can cause permission errors and may not work correctly. The Clear-RecycleBin cmdlet is the proper way.

Tips

  • Choose a low-traffic time. Schedule the task for early morning (e.g., 3 AM) when you’re not using the PC, to avoid any performance hiccups.
  • Use a weekly schedule. If you don’t delete files often, a weekly or monthly schedule is enough and reduces wear on your drive.
  • Keep important files safe. Remember that emptying the Recycle Bin permanently deletes files. Make sure you don’t have anything you might need later.
  • Consider Storage Sense instead. Windows 10 has a built-in feature called Storage Sense that can automatically delete temporary files and empty the Recycle Bin after a set number of days. To use it, go to Settings > System > Storage > Storage Sense. It’s more flexible and doesn’t require Task Scheduler.

Troubleshooting

If the task doesn’t seem to work, check the following:

  • Check the task’s last run result. In Task Scheduler, find your task, right-click, and select Run. Then right-click again and choose Properties. Go to the History tab to see if it ran successfully. A result code of 0x0 means success; other codes indicate an error.
  • Test the command manually. Open a Command Prompt and paste the command you used. If it fails, you’ll see an error message that can help you fix it.
  • Check if PowerShell is blocked. Some enterprise environments disable PowerShell. If so, use the cmd.exe alternative: for /d %%i in (C:\$Recycle.Bin\*) do rd /s /q "%%i" (but this may not work on all systems).
  • Ensure the task is enabled. In Task Scheduler, right-click the task and make sure “Enable” is not greyed out (meaning it’s already enabled).
  • Run the task with highest privileges. In the task’s properties, check “Run with highest privileges” to avoid permission issues.

Frequently Asked Questions

Will this permanently delete files without any warning?

Yes. The task empties the Recycle Bin completely, and there is no undo. Make sure you don’t need any of the files before setting this up.

Can I set it to empty only files older than 30 days?

Not with this simple method. The Clear-RecycleBin cmdlet empties everything. For age-based deletion, use Storage Sense, which lets you choose “Never”, “1 day”, “14 days”, “30 days”, or “60 days”.

Will this work if I’m not logged in?

Yes, as long as the PC is on and the task is configured to run whether the user is logged in or not. By default, a basic task runs only when you’re logged on. To change this, open the task’s properties and select “Run whether user is logged on or not”.

Does this affect the Recycle Bin on other drives?

Yes, Clear-RecycleBin without a drive letter clears all recycle bins on all drives. If you want to clear only a specific drive, use Clear-RecycleBin -DriveLetter C (replace C with the drive letter).

Can I undo a file after it’s been auto-emptied?

No. Once the Recycle Bin is emptied, the files are gone. There are third-party recovery tools that might recover some data, but there’s no guarantee.

Is it safe to use Task Scheduler for this?

Yes, Task Scheduler is a built-in Windows tool designed for this kind of automation. As long as you use the correct command, it’s safe and reliable.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →