How it works
- Give it a single file or folder, or a folder plus a pattern like *.tmp to delete only matching items inside it.
- Add an age so only items last changed at least that long ago go, and optionally include subfolders and matching folders.
- Each deleted item is recorded, so Undo file moves on the run's page brings it back from the Recycle Bin.
- Files open in another app are skipped and counted, so one locked file doesn't stop the clean-up.
- An advanced switch deletes permanently instead; KeyRoutines asks you once, the first time it really runs, and deletes nothing without a yes.
Routines that use it
Clear old temp files
Every evening, delete *.tmp files older than a day from your Downloads folder.
Prune old screenshots
Once a week, send screenshots older than 30 days to the Recycle Bin, then Show banner with how many went.
Tidy after unzipping
After Unzip file has extracted an archive, delete the original .zip so only the folder is left.
Settings
| Setting | What it does |
|---|---|
| Path | The file or folder to delete, or the folder to clean up when a name pattern is set. |
| Pattern | Only items in that folder with these names, like *.tmp (keep empty to delete the item itself). |
| Older than | Only items last changed at least this long ago. |
| Include subfoldersadvanced | Also look inside subfolders. |
| Include foldersadvanced | Also delete matching folders, not only files. |
| Permanentlyadvanced | Delete for good instead of using the Recycle Bin. Can't be undone; KeyRoutines asks you once. |
Good to know
- Only works on fixed local drives; network and removable drives have no Recycle Bin.
- Permanent deletes can't be undone.
- Hidden and system files are never chosen by a pattern.
Questions
- How do I automatically delete old files in a folder on Windows 11?
- Use Delete to Recycle Bin with the folder, a name pattern and an "older than" age, then run it on a schedule. Matching files go to the Recycle Bin, so you can restore them.
- Can I get deleted files back?
- Yes, unless you turned on permanent delete. Open the run and use Undo file moves, or restore them from the Recycle Bin as usual.