Categories
Productivity Technology

Keep Recent Folders Delete Older In DOS

There are often scenarios such as rolling backups or rolling logfiles where I create folders which have the date in the folder name.

HINT: Using the format YYYYMMDD means that an alphabetic search is also chronological!

In most cases I only want to keep a certain number of these folders and delete the older ones. The following script will implement this deletion process.