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