Script to Purge Files Older Than 30 Days
This script can be used to purge files from a designated folder when they reach 30 days old. This particular script will delete all PDF files from the designated folder. It can be edited for you needs.
A typical use would to to purge your temporary Scans folder that would otherwise grow forever. It may also be useful to delete old backup files.
Just set it up to run daily as a scheduled task and you’ll never have to think about it again.