Old useless files can take up a major chunk of your storage. Not only do these old files take up your storage but they can also slow down your PC significantly. If you find your PC running out of storage, then you can delete these old files.

But doing this manually can be time-consuming especially if you have many files. Many people don’t clear old files, like desktop files, downloads, recycle bins, etc., for a very long time, and with time, they pile up, making it a time-consuming process to delete them. 

But what if I tell you there are some ways through which you can delete old files automatically? This can be a lifesaver for people whose PC is low on storage and running slow. This article will guide you with some ways to automatically delete old files on Windows 11. 

Ways to Automatically Delete Old Files on Windows 11

Obsolete old files are a headache for real, and what’s a bigger problem is deleting them. Fortunately, there are some ways to automatically delete old files on Windows 11 that won’t take your time-

1. Using Storage Sense

Storage Sense is a storage management feature that you get with Windows 11. With Storage Sense turned on, your PC will automatically free up space by deleting old files. Here’s how you can turn it on-

  1. Launch the Settings app using the Windows + I keyboard shortcut. 
  2. Under the System tab, click on the Storage option. system storage
  3. Here, under the Storage Management section, you will see Storage Sense; turn it on. storage sense
  4. Now, click on the arrow next to the Storage Sense to customize the option. 
  5. Click on the drop-down menu under Run Storage Sense and select During low free disk space (default). run storage sense
  6. Then click on the drop-down menu under ‘Delete files in my recycle bin if they have been there for over’ and set it to 14 days. This is an optional step and you can let it be unchanged. 
  7. Click on the ‘Delete files in my Downloads folder if they haven’t been opened for more than’ drop-down menu and select a time period. You can leave it to default if you don’t want to delete the download files. 
  8. Once done, click on the Run Storage Sense Now button. 

2. Using Command Prompt

Another way to automatically delete old files on Windows 11 is using Command Prompt. Here’s how you can use the command prompt to do so-

  1. Press the Windows + R key combo, type cmd, and then press Ctrl + Shift + Esc keys together. 
  2. A UAC prompt will open up; click on the Yes button to continue. 
  3. Execute the given below command-
ForFiles /p "C:\path\to\folder" /s /d -30 /c "cmd /c del /q @file"

Note– Here replace C:\path\to\folder  with the storage path where you want to delete files. For instance, if you want to delete files of New Folder in C drive, then replace it with C:\New Folder

The above command will delete files from the given path that were modified within the last 30 days. It will also delete files from the search folder, and won’t ask you the permission to delete the file. 

3. Using Task Scheduler

As the name suggests, you can use Task Scheduler to schedule some tasks on your PC. One of the effective methods of using it is setting a schedule to delete old files automatically on your Windows PC. Here’s how to do that-

  1. From the Start Menu, launch the Task Scheduler
  2. Here, right-click on Task Scheduler Library and then on New Folder. You can set any name for the task scheduler. 
  3. Now, right-click on the new folder that you have created, and then click on Create Task.
  4. Under the General tab, Enter the name of the task in the next window. 
  5. Now under the Security Options section, select Run whether user is logged on or not, and uncheck the Do not store password option. 
  6. Click on the Triggers tab now, and click on the New button. 
  7. Click on the drop-down menu next to Begin the task and select On a Schedule option. 
  8. Set Actions to Start a program.
  9. Under the Program/Script text field, enter ForFiles
  10. Now, in the text field next to the Add Arguments box, enter the following command-
    • /p "C:\path\to\folder"/s /d -30 /c "cmd /c del /q @file"
  11. Now, head to the Settings tab, and check the checkbox saying Allow tasks to be run on demand and Run task as soon as possible
  12. Also, check the checkbox saying It the task fails, click on the drop-down menu next to it, and select a suitable time frame. 
  13. Once done, click on OK and close Task Scheduler. 

Bottom Line

It is a wise choice to delete old files on your PC. This makes your PC efficient by enhancing its performance. However, if you don’t want to do it manually then this guide will help you with the automatic methods to it. You can follow the above guide to automatically delete old files on Windows 11. 

LEAVE A REPLY

Please enter your comment!
Please enter your name here