Three Methods for Windows 10 and 11 to Automatically Delete Old Files

Three Methods for Windows 10 and 11 to Automatically Delete Old Files

If you frequently download files or take screenshots but don’t remember to remove them afterwards, your computer’s storage might easily fill up. What then is the remedy? We can assist you in automatically erasing older files from your Windows computer using three easy approaches.

Actually, we will be utilizing our laptop—which is loaded with old documents and screenshots—as an example to demonstrate to you how to have Windows automatically remove old files in the background.

Pros and Cons of File Auto-Deletion

Similar to every technology, auto-deleting data offer benefits and drawbacks. Consider the following benefits and drawbacks:

Three Methods for Windows 10 and 11 to Automatically Delete Old Files

Pros:

  • The most obvious benefit of setting up an auto-deletion mechanism is that it saves a ton of time and work as there is no need to manually erase files.
  • It keeps extraneous files off of your computer, which can enhance system speed.
  • Additionally, you lessen the possibility of inadvertently leaving private or sensitive data on your computer by setting up automatic file deletion.

Cons:

  • Unintentional file deletion is one of the main concerns that people have.
  • It’s possible that files you want to keep will be removed because you don’t have much control over what kinds of files auto-delete will remove.
  • It could be difficult or impossible to recover the files once they are erased.
  • It can be difficult to set up auto-deletion rules, and incorrect configurations may lead to issues like accidental file removals.

#1. Using Storage Sense

Using Windows PC’s Storage Sense feature is one of the easiest ways we suggest to any novice or less tech-savvy user. With its straightforward design and easy-to-use interface, you can effortlessly handle the majority of downloaded files and temporary files that have been residing in the background of your computer for a long time.

To configure Storage Sense, follow these steps:

For Windows 11:

  • Press the Windows Key + I to access Settings > System > Storage.
  • Turn on the Storage Sense toggle after that.
  • Select the cleanup duration for Storage Sense, Recycle Bin, and Downloads Folder by clicking on it to configure Storage Sense.

We’ve configured the following on our laptop:

  • Launch Storage Sense: Each week
  • Thirty days to remove files from my recycle bin
  • 60 days to remove files from my downloads folder

That’s it! Now, in accordance with the schedule you have specified, it will automatically remove all of the older files from your computer.

You can manually launch Storage Sense by clicking the “Run Storage Sense now” button, which will start to remove all older or temporary files from your Windows PC.

For Windows 10:

  1. Press Windows Key + I to open the Settings app, then select the System page.
  2. Proceed to the Storage area and activate the Storage Sense function there.
  3. Click the Configure Storage Sense or run it now link to make changes.
  4. After that, you can adjust the parameters to suit your needs.

Similarly to Windows 11, all you have to do to manually launch Storage Sense is click the Clean now icon.

#2. Using Microsoft PC Manager

Microsoft PC Manager is a new utility that the company released in 2022 for Windows 10 and 11. You can control memory use and remove temporary files with this easy-to-use program. To help you keep your PC clutter-free, the software also has an option to automatically erase temporary files. This is how it operates:

  • Open the Microsoft PC Manager program after downloading it, if you haven’t previously.
  • Next, pick the Settings option by clicking on the Gear/Cog symbol.
  • Toggle the option next to “PC Manager will automatically boost your PC” to finish.

You can manually remove the data if the PC Manager was unable to automatically remove the files because of a bug. To accomplish this, simply click the Boost button, and your computer’s temporary files and memory use will be immediately deleted.

#3. Using Command Prompt

Not only can you remove older files with the command prompt, but you can also decide when to remove them based on how many days have passed. Now let’s get started:

It should be noted that you cannot directly undo the activity of the “ForFiles command” and prevent it from automatically removing files. Moving the contents of the folder to a new location is essentially your only option.

#1. Press Windows Key + S to open Windows Search and search for Command Prompt. When it’s located, right-click on it and choose “Run as administrator.”

#2. Then, to remove the particular files that you haven’t changed in the last 30 days, do the following command:

ForFiles /p "C:\Path\To\Folder" /s /d -30 /c "cmd /c del /q @file"

This is what the command ForFiles accomplishes:

  • /p – tells the ForFiles where to begin looking for files.
  • /s – makes the command search in subfolders too.
  • /d – specifies the last modified date for a file.
  • /c – Instruct the ForFiles to do something with the files. It’s usually ‘cmd /c del @file.’
  • /q – won’t ask for your confirmation to delete files.

Use the ‘ForFiles /?’ command (no quotes) to get more information about each command in detail.

For example, we replaced “C:\Path\To\Folder” with the path of our particular folder. In order to better meet our demands, we also changed the modification date from 30 to 15.

ForFiles /p "C:\Users\nkura\OneDrive\Pictures\TechWiser" /s /d -15 /c "cmd /c del /q @file"

The graphic below shows how quickly the outdated files that had not been changed in 15 days were erased.

Clear Out the Clutter on Your Windows Computer

Our Windows PCs used to be constantly cluttered with several outdated screenshots and downloaded files, half of which were useless as soon as we finished using them. But we no longer need to manually remove outdated files because of the techniques mentioned above. The only thing we need to be careful about is moving any crucial files to a different location or making sure they are not added to the folder designated for auto-deletion. We hope you found the preceding guide to be helpful as well.

You Might Also Like

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *