How to Delete Files Older Than X Days in Folders and Subfolders

I'm a Windows user and want to remove files older than X days, I'm looking to free up space while also keeping my data organized. Too many temporary files also eat RAM storage, affecting my system's speed in this situation. What can I do?

Best Answered by

Dany· Answered on Mar 10, 2023

Follow these instructions to have Windows delete more than X days old files. You can delete all files older than a particular number of days from your computer using Storage Sense and the Windows Command prompt.

Storage Sense is an integrated utility in Windows 11. Although Storage Sense can be used manually, you can also set it to do maintenance automatically to avoid running out of space too rapidly. To make Storage Sense operate automatically, follow these steps:

  • Click the Start button, then the "Settings" button.
  • Go to System - Storage and enable "Storage sense".
  • Click "Configure Storage Sense," then check or uncheck the boxes next to Temporary Files and Locally available cloud content. You can also select the best choice for your situation from the "Run Storage Sense" drop-down menu.

Furthermore, you can manually free up disk space on your PC. It is always critical to ensure that your disk does not run out of space. Resetting your computer may help, but you may lose other data. As a result, use the options below to free up disk space in Windows 11.

When you delete files in Windows 11, they are not deleted from the hard disk. They are instead placed in the Recycle Bin in case you need them back. However, depending on how the feature is configured, the Recycle Bin can consume a lot of space over time. As a result, the first step to reclaiming valuable storage space is to empty the bin.

You can also use the old Disk Cleanup tool to clear up space. It's a built-in program in Windows 11 that frees up disk space and improves performance. It is one of the simplest methods for cleaning up files.

The deletion feature will remove your files without caution if you enable to delete files older than x days in Task Scheduler. You may be interested in learning how to stop Windows 10 from deleting files automatically and how to restore these auto-deleted data on Windows. You can use EaseUS Data Recovery Wizard to retrieve such files manually.

Use EaseUS Data Recovery Wizard to recover deleted or lost files easily and quickly.

Tutorials on how to recover lost, deleted, or formatted data from HDD, SSD, USB, SD card, or other storage media on Windows and Mac.

People Also Ask

Use Shell Script to Delete the Files from Directory Based on Date Parameter

You can use a Shell script to delete the files from the directory based on the date parameter, but it is risky and easy to lose essential files. We will show you how to delete these files older than 2000 on your computer.


Feb 22, 2023

Download Folders Disappeared from Dock on Mac, How to Recover

How can Downloads be got back on the Dock? You can use the instructions in this article to get your Mac's Dock to display the missing Downloads folders and discover why your Downloads vanished out of nowhere.


Feb 22, 2023

How to Recover Deleted Files from Sony A7III SD Card on Mac

It is easy to delete photos or videos accidentally on Sony A7III cameras. The files will not be erased immediately from your Sony A7III SD card until writing new data on this SD card. Let us find a way to recover files from a Sony A7III SD card.


Mar 09, 2023

How to Create A Batch File to Delete Files Older Than N Days

You may save space and keep things ordered by removing files in any folder that are more than a certain number of days old. If you have a lot of files in several directories and wish to clean them up by removing those that are older than a certain number of days, you can use the ForFiles command.


Mar 10, 2023

How to Delete Files on a Particular Date with Unix

If you have a list of files but only want to delete files older than a particular date with Unix. This post teaches you the specific command line to run a helpful script. You can also protect your data security with the help of EaseUS Data Recovery Wizard.


Feb 22, 2023

How to Delete Files in File Server Automatically

Are you tired of useless files taking up space on your computer? Then, using Linux, and CMD, utilize this straightforward method to delete files older than x days. We can also help you restore inadvertently deleted files on Windows 11/10.


Mar 10, 2023