4 Ways to Delete Files Older Than a Certain Number of Days on Windows

Want to delete the pictures you saved a few days ago? Or, perhaps you want to remove the files you downloaded last week.

Whatever the case may be, we’ve got you covered. In this article, we’ll explore different ways to delete files from a specific date, be it a day, a week, a month, or even a year ago.

4

1. Use File Explorer

There’s no denying that File Explorer is one ofthe best file management tools for Windows. So, let’s check out how this tool can help you delete specific files:

Finally, select the files you don’t need and then press theDeletekey.

A trash can

Alternatively, you can search for your files using a specific date. For example, here’s how to search for files that were modified on a certain day:

Finally, select and delete the files you don’t need.

Selecting an option from the “Date modified” drop-down menu

To pick a date range, follow these steps:

To search for your files based on the date they were created, follow these steps:

Mouse pointer placed on the “Date modified” option on the File Explorer search bar

To pick a date range for the “date created” option, follow these steps:

2. Use the Command Prompt

The Command Prompt is a powerful tool that you may use for various purposes. For example, you can use it to tweak the system settings or run various apps.

Interestingly, the Command Prompt can also help you remove files on Windows. So, let’s see how you can delete your old files using this tool:

Mouse pointer placed on the “Date created” option on the File Explorer search bar

Replace theC:\Target_Folderwith the correct folder path. From there, replace theNumber_of_Dayscommand with the number of days in which the files were last modified.

Here’s how you can find your folder path:

You now have your folder path.

So, you can now decide on the files you want to delete. For example, let’s say you pick files that were last modified 14 days ago.

With all the details you currently have, here’s what your command should look like:

After entering all the details in your command, pressEnterto start deleting your files.

3. Use the Task Scheduler

You can also delete your files byusing the Task Scheduler. Here are the steps you need to follow:

Right-click on theDelete Old Filesfolder and selectCreate Task. This should take you to the “General” tab on the “Create Task” window.

Specify the task name in the “Name” box. For example, you can name the task asDelete Old Files in the Downloads Folder.

From there, scroll down and select theRun whether user is logged on or notoption. Next, click theConfigure fordrop-down menu and select the relevant option.

From there, scroll to theTriggerstab and press theNewbutton at the bottom. This should display the “New Trigger” window.

Follow these steps once you’re on the “New Trigger” window:

Navigate to theActionstab and press theNewbutton at the bottom. This should display the “New Action” window.

Follow these steps when you’re on the “New Action” window:

Replace theNumber_of_Dayscommand with the number of days in which the files were last modified. For example, you can pick 21 if you want files that were last modified three weeks ago.

From there, replace theTarget_Foldercommand with the correct folder path. For example, if your original folder path is C:\Users\tladi\Downloads, then you should replaceTarget_FolderwithUsers\tladi\Downloads.

By now, you have all the information you need. So, you should haveForFiles.exein the “Program/script” box and the following command in the “Add arguments” section:

Press theOKbutton after entering the details.

Now, your files should be deleted automatically using the task you’ve created. To get rid of this task at a later stage, open the Task Scheduler and remove theDelete Old Filesfolder.

4. Use the System Settings

Want to automatically delete old files from the Recycle Bin or the Downloads folder? The system settings can help.

Here are the steps you need to follow:

Next, click theDelete files in my Recycle Bin if they have been there fordrop-down menu and configure the settings to your liking.

Finally, close the settings windows and restart your device to save these changes.

Delete Any File on Your Windows Device, Hassle-Free

Deleting files on Windows is quite easy. But sometimes, you just want to delete files using a specific date range.

So, if you need to delete files older than a certain number of days, try the solutions we’ve covered. And if those files refuse to leave your device, there are solutions for that too.

Can’t find a way to uninstall a program? Or is it flat-out refusing to leave? Here’s how to scrub it away once and for all.

My foolproof plan is to use Windows 10 until 2030, with the latest security updates.

Not Linux, not Windows. Something better.

Some subscriptions are worth the recurring cost, but not these ones.

It’s not super flashy, but it can help to keep your computer up and running.

Not all true crime is about hacking, slashing, and gore.

Technology Explained

PC & Mobile