Automated file cleanup using Windows Task Scheduler. Deletes files from specified folders on a timed schedule.
This project contains batch scripts (.bat
) that automatically delete files from specific folders (e.g., Screenshots
and Downloads
).
The cleanup process is scheduled to run daily at 00:00.
✅ Deletes files from specific folders.
✅ Runs automatically every day at midnight (customizable).
✅ Uses Windows Task Scheduler for execution.
✅ If the scheduled task is missed, it runs as soon as the user logs in.
✅ Purpose: Prevents manual file accumulation and saves disk space.
You can find a collection of .bat
scripts on https://github.com/t-ros/Scheduled-File-Cleaner/tree/main/Scripts
, edit them to specify the directories you want to clean.
- Press
Win + R
, typetaskschd.msc
, and press Enter. - Click "Create Task..." in the right panel.
- Name:
Scheduled File Cleaner
- Security options:
✅ "Run only when user is logged on"
✅ (Optional) "Run with highest privileges"
- Go to the Settings tab:
✅ "Run task as soon as possible after a scheduled start is missed"
✅ (Optional) "Stop the task if it runs longer than X minutes" - Click OK.
- Go to the Triggers tab → Click "New...".
- Begin the task:
On a schedule
- Settings:
Daily
- Start time:
00:00
- Repeat every:
1 days
- Go to the Actions tab → Click "New...".
- Action:
Start a program
- Program/script: Browse and select your
.bat
file.
To verify if the script runs correctly:
- Right-click the task in Task Scheduler → "Run".
- Check the folders you tried cleaning to confirm files were deleted.