Open In App

How to Automatically Delete Old Files in Windows 11?

Last Updated : 03 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Managing storage space efficiently is crucial for maintaining a smooth and responsive system. Windows 11 offers built-in features to help you automatically delete old files, freeing up valuable disk space without manual intervention.

Whether you're looking to manage temporary files, downloads, or other unused files, our step-by-step instructions will help you keep your system clean and optimized.

4 Methods to Automatically Delete Old Files in Windows 11

In this guide, we'll show you how to set up automatic file deletion in Windows 11 using built-in tools and settings. With these easy steps, you can keep your storage clean and organized without the hassle of manually deleting files. Let's get started!

Method 1: Auto-Delete Old Files or Folders Using Storage Sense

The Settings’s Storage Sense feature automatically removes files or folders when storage space is running low.

Step 1: Press Win + I to open the settings app then navigate to System > Storage.

Automatically Delete Old Files

Step 2: Toggle on Storage Sense.

Automatically Delete Old Files

Step 3: Click the Storage Sense to customize its settings.

Step 4: In the Configure cleanup schedules section you can select the time frame that suits you best for running the Storage Sense option.

You have the option to run it every day, every week, every month or during low free disk space (which is the default setting).

Automatically Delete Old Files

Step 5: Once everything is configured, click the Run Storage Sense Now button

Automatically Delete Old Files

Method 2: Delete Old Files or Folders Using Command Prompt

You can use Command Prompt to delete old files or folders in Windows 11. This method is useful if you prefer to work with text commands. Follow these simple steps:

Step 1: Press Win + R on your keyboard. This will open the Run dialog.

Step 2: Type cmd into the Run dialog. Press Ctrl + Shift + Enter.

Automatically Delete Old Files

Step 3: In Command Prompt, Type this command "ForFiles /p "C:\path\to\folder"/s /d -30 /c "cmd /c del /q @file"" to delete files older than 30 days in a specific folder.

Step 4: Hit Enter to delete the file or folder

Remember to use this method with caution, as the files or folders you delete using Command Prompt cannot be easily recovered. Make sure to review the files you want to delete before running the command.

Method 3: Delete Old Files or Folders Using Task Scheduler

Using Task Scheduler in Windows 11, you can set up a task to automatically delete old files or folders on a regular schedule. This method can be helpful for keeping your system tidy without manual intervention. Here's how to set it up:

Step 1: Press Win + S then on the search bar type “Task Scheduler”

Automatically Delete Old Files

Step 2: Right Click on “Task Scheduler Library” then click on “New Folder”

Automatically Delete Old Files

Step 3: Enter any name you want and click OK.

Step 4: Right Click on the newly created folder then click on “Create a task”

Automatically Delete Old Files

Step 5: Enter any you want in the name field then enable the Run whether the user is logged on or not.

Automatically Delete Old Files

Step 6: Select your preferred schedule for running the task and click OK. Then, Navigate to the “Actions” tab.

Step 7: In the actions tab click on “New” then on Program/scripts field type this command “ForFiles /p “old file path”/s /d -30 /c “cmd /c del /q @file””

Step 8: Replace "old file path" with your desired directory, and use -30 to represent the last modified time, as an example:

ForFiles /p “C:\Users\Saurabh\Documents\New folder” /s /d -30 /c “cmd /c del /q @file”

Automatically Delete Old Files

Step 9: Click Ok. Then, Navigate to Settings tab and check the following checkboxes:

  • If the task fails, restart every.
  • Run tasks as soon as possible after a scheduled start is missed.

Using Task Scheduler is a great way to automate the deletion of old files or folders in Windows 11, helping you maintain a clean and efficient system.

Method 4: Delete Old Files or Folders Using Microsoft PC Manager

Using Microsoft PC Manager is an easy and convenient way to automatically delete old files or folders in Windows 11. This tool offers a straightforward way to manage and optimize your system's storage. Here's how you can use it:

Step 1: Open Microsoft store then on search bar type “Microsoft PC Manager” then click on “Get” on right side pane

Automatically Delete Old Files

Step 2: After installing open Microsoft pc manager

Step 3: In PC Manager, Click on Settings on the left side pane.

Step 4: Toggle the Smart Boost

Automatically Delete Old Files

By using Microsoft PC Manager, you can easily manage your storage and delete old files or folders without hassle. This method is a great option for those who want a user-friendly way to optimize their Windows 11 system.

Conclusion

Automatically deleting old files in Windows 11 is a straightforward process that can significantly improve your system's performance and free up storage space. By following the steps outlined in this guide, you can set up automated file cleanup and ensure your computer remains clutter-free. Take advantage of Windows 11's built-in tools to maintain a clean and efficient system effortlessly.


Next Article

Similar Reads