How To Automatically Remove Old Downloads from the Downloads Folder?

We all do it, download that image, this program, that song and end up with a lot of downloads in our downloads folder that we really don’t need anymore. Using this method you can easily set up that Windows removes all files in the Downloads folder older than x days.

 

WARNING: Be really careful using this method. Do not use the root hard disk folder in this command as it will remove windows and other crucial files from your system.

 

Before we start

icon-user You need to be an Administrator to execute these steps

icon-lightbulb-o You require Proficient level Windows skills. You need to familiar with Windows Command Prompt and Administrative tools.

icon-clock-o You require around 15-30 minutes to complete all steps.

 

How To Automatically Remove Old Downloads after X days.

Preparing the Batch File.

1. On your keyboard press the Windows and R key at the same time, then type Notepad in the Run window and click on OK. (Or open start and type Notepad. Then choose Notepad)

2. In notepad enter the following text

forfiles -p “C:\Users\changethis\Downloads\” -s -m *.* -d –30 -c “cmd /c del @file”

Change the blue text into your account name. Check the Users folder to make sure what the name is.
Change the red number above to any number of your liking. This will be the removal threshold. Any file older than that number (in days) will be removed. So in this case 30 days.

3. Then in notepad click on File and choose Save as…

4. Type the name you want to use and end it with .bat, also make sure to save it as All Files displayed in the image below.

Save as Bat How To Automatically Remove Old Downloads from the Downloads Folder?

Creating an Automation Task

1. Open Task Scheduler of Windows by Right-Clicking the Windows icon in the start tray. Then choose Control Panel
2. Within Control Panel. Click on System and Security

System and Security How To Automatically Remove Old Downloads from the Downloads Folder?

System and Security

3. Within System and Security, click on Administrative Tools

Administrative Tools How To Automatically Remove Old Downloads from the Downloads Folder?
4. Within Administrative Tools, double-click Task Scheduler

Task Scheduler How To Automatically Remove Old Downloads from the Downloads Folder?
5. Then click on Create Basic Task in the right-side pane.
6. Enter the name and description of the task and then click Next.

Create Basic Task How To Automatically Remove Old Downloads from the Downloads Folder?
7. Then choose when to run the command, such as every time when you logon to Windows. Then when you did that click on Next
8. Then choose Start a Program and click Next
9. Browse to the application we created (.bat file) and choose that.

Add the Program How To Automatically Remove Old Downloads from the Downloads Folder?

10. Then click next to finish creating the task.

That was all you have to do. Hopefully this guide has helped you set up Windows in such a way that your downloads folder will be clean forever.

What's your reaction?
Solved it!
0%
Helped me
0%
Didn't work
0%
Inaccurate Information
0%
About The Author
Yuri Pustjens
Yuri Pustjens
2014, 2015 & 2016 Microsoft Most Valuable Professional Windows Yuri specializes in troubleshooting (crash analysis and devices), system resource utilisation and system performance. He is also very interested in Customer Security. Yuri can be found as Windows Community Moderator and Wiki Author on Microsoft Answers and is active on different communities all across the web.

Leave a Response