Are old documents, backups, and downloads quietly eating up your Windows PC’s storage — taking up space and slowing things down? What if you could set it once and forget it: have Windows automatically delete files older than X days? In this guide, we’ll show you proven ways to auto-delete old files on Windows 10/11 — whether you prefer built-in tools, a command-line script, or a scheduled task. Let’s get your drive cleaned up for good.”
Before proceeding, let’s first see why it is important to delete old files from your computer….?
Using pc for software installation and web surfing usually creates a lot of junk files. Although it won’t cost more to keep them on a PC still there are still chances of a lack of system storage and other issues related to computer performance. In some cases, even experts recommend removing these old files from Windows to keep them safe from unwanted, harmful files, as well as keep the PC organized.
So, it is always good to keep your system in good health by just deleting your Windows’ old files. It might be a rare chance to delete them manually by using Windows’ built-in features or with some third-party PC cleaner software. But, it is good enough if we use Windows’ built-in settings to assign scheduled tasks to auto-delete old files from Windows.

2 ways to delete old files from Windows automatically:
Compatible with the latest versions of Windows 10 and 11, which have built-in settings to enable and disable the automatic deletion of old Windows files.
So let’s move to read to words described below.
1- Use of Storage Sense settings:
The first option to auto-delete old files from Windows 11 is to use Storage Sense settings. However, Windows has selected the option to auto-delete when low free disk space appears. However, you can choose other options for your convenience. So just follow the steps:
- Press the Win + I Keys to open the Settings menu and select System from the left side panel.
- Click on the Storage and then toggle to Storage Sense Option.
- Click Storage Sense and under Configure cleanup schedule, select the desired time frame to run Storage Sense. You can choose the option of
- Every Day.
- Every week.
- Every Month
- During low free disk space (default)
- You can also configure the Recycle bin option to keep the deleted files for your desired duration.
- Also, there is an option to delete files automatically from the Download folder of Windows.
- After all, just click the Run Storage Sense Now button to let Windows choose the desired options to control its old files.7
2 – Use of Command Prompt to delete old Windows Files:
The second way to automatically delete unnecessary old windows from the computer is using a command prompt. So here are the simplest commands to do so:
- Type Command Prompt in the search bar and Run as administrator.
- To delete the old files or those files that you have not used in the previous 30 days, just copy and paste the following command and hit enter;
ForFiles /p "C:\path\to\folder"/s /d -30 /c "cmd /c del /q @file"
Conclusion:
Decluttering your Windows PC by auto-deleting old files doesn’t have to be a chore. Whether you use the built-in Storage Sense, a targeted script, you can free up space and avoid manual cleanup. Pick the method that fits your comfort level and folder type, set it up once, and let your PC clean itself.