I now have a seemingly innocuous requirement to be put in a .bat file ,I am dealing with Batch code for the first time ...found a page here that deals with something similar but it takes the modified date as reference.
In a particular folder X , Delete all files older than N days by parsing through their file name. where file name format is Name_YYYYMMDD.log
But note : 1. Do not want the last modified date as reference (log might have been accessed/modified by other programs/apps) 2.No permission to install other utilities.
EDIT :
- The FORFILES command worked perfectly well for this job (but only drawback is it takes'modified date' as reference)
- The script below by Aacini works fine after tweaking it to specifications.
- Due to additional conditions which further complicates the entire scenario ,we have decided to move away from batch and do it in Powershell or AutoIT.
Thanks!.