Say Goodbye to Old Files: Enabling the Autodelete Option on Windows 11

Say Goodbye to Old Files: Enabling the Autodelete Option on Windows 11

Richard Lv13

Say Goodbye to Old Files: Enabling the Autodelete Option on Windows 11

For many, a cluttered desktop and downloads folder is just a way of life—no matter how hard you try, they somehow always ends up disorganized. Need to do a bit of digital spring-cleaning? Fortunately, there are lots of ways you can keep your Windows 10 computer decluttered.

You can get rid of Windows 10 bloatware. You can sort your right click menu. You can even declutter your search results. And of course, you can clean up your desktop. If you’re looking for a more passive approach, here’s how to erase old files on Windows 10 and 11.

1. Auto-Delete Old Files or Folders Using Storage Settings

The Settings menu lets you do and manage a lot of stuff on your Windows computer. From updates to tweaking the Windows appearance—you can do almost everything. It’s no surprise then that you can also use it for setting up an auto-deletion setting on your Windows. Here’s how:

storage settings on windows

  1. Go to Settings > System > Storage.
  2. Toggle on the Storage Sense feature.
  3. Then, click Configure Storage Sense or run it now.
  4. Under Temporary Files, set up your desired time frames fore deleting files in the recycle bin and files in your Downloads folder.
    storage sense in windows settings

Not all files in the Downloads folder will be deleted after the set time; just those that haven’t been opened. This means if you download a file and want to open it later, it will still be deleted after the set time. If you turn this setting on, you should move anything out of the Downloads folder that you intend to keep.

If you want, you can always turn off the setting by simply disabling the Storage Sense button later on.

2. Deleted Old Files or Folders With the Command Prompt

Like most things on Windows, you can use the Command Prompt here as well. A replacement for the easy pin-and-point graphical user interface, the Command Prompt works with simple text-based commands to help you perform different admin functions and fix various troubleshooting issues on Windows.

Here’s how you can use it to fix your storage issues via the ForFiles command on Windows:

  1. Head to the Start menu search bar, type in ‘cmd’, and run the CMD as an administrator.
  2. Now, to delete the files that you haven’t modified in 30 days, type in the following command and hit Enter:
    ForFiles /p "C:\path\to\folder"/s /d -30 /c "cmd /c del /q @file"

The “C:\path\to\folder” and /d -30 here refer to the folder path from where you want to delete files and the specific time for which you’d like to delete your file. Replace them with the settings that suit you.

command prompt on windows

Your files will be removed as quickly as soon as you hit the above commands.


VSDC Pro Video Editor is a light professional non-linear video editing suite for creating a movie of any complexity. It supports the most popular video/audio formats and codecs, including 4K, HD and GoPro videos. Preconfigured profiles make the creation of videos for various multimedia and mobile devices absolutely hassle-free.

Key features:

• Import from any devices and cams, including GoPro and drones. All formats supported. Сurrently the only free video editor that allows users to export in a new H265/HEVC codec, something essential for those working with 4K and HD.
• Everything for hassle-free basic editing: cut, crop and merge files, add titles and favorite music
• Visual effects, advanced color correction and trendy Instagram-like filters
• All multimedia processing done from one app: video editing capabilities reinforced by a video converter, a screen capture, a video capture, a disc burner and a YouTube uploader
• Non-linear editing: edit several files with simultaneously
• Easy export to social networks: special profiles for YouTube, Facebook, Vimeo, Twitter and Instagram
• High quality export – no conversion quality loss, double export speed even of HD files due to hardware acceleration
• Stabilization tool will turn shaky or jittery footage into a more stable video automatically.
• Essential toolset for professional video editing: blending modes, Mask tool, advanced multiple-color Chroma Key

3. Use Task Scheduler on Windows

Task Scheduler is a simple Windows tool that lets you easily automate your repetitive Windows tasks. Just set up the task, and the app will handle whatever you have asked it to do. When it comes to auto-deleting your files or folders, the ForFiles command is what you will need to help you delete your older files or folders.

Here’s how you can automate the deletion:

  1. Head to the Start menu search bar, type in ‘task scheduler’, and select the best match.
  2. Right-click on Task Scheduler Library and select New Folder.
  3. Put in any name and click on OK.
  4. Right-click on the recently created folder and select the Create Task option.
    task scheduler
    Epubor Ultimate for Win:Helps you read books anywhere, including the best eBook Converter + eBook DRM Removal functions.
  5. In the Name box, enter a name for the task.
  6. Now, in the General tab, under the Security options section, select the Run whether the user is logged on or not option.
  7. Make sure the Do not store password checkbox is unselected.
  8. Click on the Triggers tab and select the New button.
  9. Select On a schedule option using the Begin the task setting.
    new trigger section on task scheduler
  10. Under the Settings section, set up the timings of the tasks you’d like to run. Finally, click on OK.

Now, head to the Actions tab and click on the New button. From the Actions drop-down menu, select the Start a program option.

In the Program/script box, type in the following command:

ForFiles

new action tab on windows

Similarly, in the Add arguments box, type in the following command:

/p "C:\path\to\folder"/s /d -30 /c "cmd /c del /q @file"

In the above command, tweak the “C:\path\to\folder“ to the path of the folder where your files are and replace “/d -30“ with actual number you’d like pick. So, your command will become something like this:

/p "%userprofile%\Users\[Your Username]\Downloads" /s /d -30 /c "cmd /c del /q @file"

Click on OK. Finally, from the Settings tab, check the following checkboxes and then click on OK:

  • Allow task to be run on demand.
  • Run the task as soon as possible after a scheduled start is missed.
  • If the task fails, restart every.

new action setting on windows

ZoneAlarm Pro Antivirus + Firewall NextGen

That’s it—finalize the changes by clicking OK once again, and you will be done in no time. From here forward, your files will be automatically deleted within the specified time. Of course, if you later change your mind you can always reverse this setting by simply deleting the new folder your created in first step (which in our case, will be New Folder 1).

Auto-Deleting Old Files or Folders on a Windows Computer

Keeping unnecessary files on your computer is seldom useful. They eat up memory space, hamper your PC’s performance, and clog the file organization. Setting up auto-delete instructions, with whichever method you prefer, lets you rid your PC of this extra baggage.

However, we’d add that auto-removing files or folders from your PC is just one part of cleaning up your Windows. There are many other important hacks such as removing unused apps, terminating pointless background processes, and tweaking settings to whatever is most relevant to your situation. So, make sure you follow all the best principles for running your Windows as smoothly as possible.

You can get rid of Windows 10 bloatware. You can sort your right click menu. You can even declutter your search results. And of course, you can clean up your desktop. If you’re looking for a more passive approach, here’s how to erase old files on Windows 10 and 11.

  • Title: Say Goodbye to Old Files: Enabling the Autodelete Option on Windows 11
  • Author: Richard
  • Created at : 2024-08-16 02:00:17
  • Updated at : 2024-08-17 02:00:17
  • Link: https://win11-tips.techidaily.com/say-goodbye-to-old-files-enabling-the-autodelete-option-on-windows-11/
  • License: This work is licensed under CC BY-NC-SA 4.0.