Immediate Learning Windows Windows 10

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.

 

[symple_box color=”red” fade_in=”false” float=”center” text_align=”left” width=””]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. [/symple_box]

 

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

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
System and Security

3. Within System and Security, click on Administrative Tools

Administrative Tools
4. Within Administrative Tools, double-click Task Scheduler

Task Scheduler
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
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

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.

Leave a Reply

Your email address will not be published. Required fields are marked *