Do you have any idea how to delete files older than a specific date? This post from MiniTool provides you with several helpful methods to remove files older than X days. At the same time, free data recovery software is also introduced here to help you recover accidentally deleted files.

In previous posts, we talked about how to add the Permanently delete option to the context menu and delete files permanently . Now you can see how to delete files of a particular date range in a couple of ways.

How to Delete Files Older Than a Specific Date

Way 1. Using the Date Modified Feature in File Explorer

File Explorer, also called Windows Explorer, is a file manager application in Windows that allows you to browse, edit, and delete folders and files. You can follow the guide below to delete files older than a specific date.

Step 1. Press Windows + E key combinations to open File Explorer.

Step 2. Move on to the folder that contains unwanted files, and click the search box in the upper right corner to view the Search Tools ribbon.

Step 3. Click Date modified and select a time range of unwanted files as shown below.

select a date range

Step 4. Wait for the search result to load completely, and press Ctrl + A to select all files. Then right-click them to select Delete .

Windows 10 Indexing Is Not Running? Useful Ways for You
Windows 10 Indexing Is Not Running? Useful Ways for You

Windows 10 indexing is not running? Many people have reported that they are struggling with this issue. If you have trouble, this post may resolve the issue.

Read More

Way 2. Using Windows Settings

The second way to remove files older than X days is by using Windows Settings.

Step 1. Press Windows + I key combinations to open Settings.

Step 2. Click System > Storage > Change how we free up space .

Step 3. Turn on Storage sense by highlighting the button under it. Then check the checkboxes under the Temporary Files section based on your own needs.

turn on Storage sense

Step 4. Click Clean now to free up the space now.

Way 3. Using CMD

As you can see, you can remove files older than X days in Settings. However, you cannot specify specific files or folders to be deleted. To break this limit, you can use CMD to delete unwanted files.

Step 1. Type cmd in the Windows search box and right-click Command Prompt from the best match result to select Run as administrator .

Step 2. Click Yes in the UAC window .

Step 3. Type the following command in the Command Prompt window: ForFiles /p “folder path” /s /d -date /c “cmd /c del /q @file”.

  • Remember to replace the folder path with the actual folder location path.
  • Remember to replace the date with the date you want to delete files older than.

This is an example: ForFiles /p “C:\Users\bj\OneDrive” /s /d -30 /c “cmd /c del /q @file” .

input the command to delete files older than 30 days

Step 4. Press Enter to execute the command line.

How to Recover Accidentally Deleted Files

Now you have already known how to delete files older than a specific date. However, some needed files may be deleted due to wrong operations or other reasons. In this situation, how to get them back?

I recommend you use free data recovery software – MiniTool Power Data Recovery to restore deleted or lost files in Windows 11/10/8/7. It is a professional data restore tool supporting scanning and recovering documents, pictures, videos, emails, and more from internal hard drives, external hard drives, USB flash drives, and so on. You can download the free edition to have a try.

Free Download

With only three steps, you can get lost files back effectively.

Step 1. Launch MiniTool Power Data Recovery.

Step 2. Under the Logical Drives tab, select the partition where lost files are stored before and click the Scan button.

select the target partition to scan

Step 3. Preview and select all needed files. Then click Save to choose a safe storage place for them (It is highly recommended to choose another drive for preventing data overwriting ).

save all wanted files

7 Ways to Fix Make Sure Your Temp Folder Is Valid
7 Ways to Fix Make Sure Your Temp Folder Is Valid

This article focuses on the error message “make sure your temp folder is valid” and lists several ways to help you get rid of this error.

Read More

Wrapping Things Up

Now you should know how to delete files older than a specific date. Hope the methods listed above are helpful for you.

For more information about computer knowledge, welcome to visit MiniTool News Center .

  • Linkedin
  • Reddit