Im looking for a batch Script to del a certain type of file extension from a large database we have. The database contains dated folders ranging back over a decade. I need to clear these cap files out but it takes an incredibly long period of time to scan the whole database. Is there a batch script that would limit the scan to files only from the last year or preferably from the last week. So far this is what I have.
del .\*.cap /s /q
I realize this looks through the whole directory but since the dated folders are created daily and each has a large number of subdirectories, Im uncertain of how to specify only the most recent files.