ePDM Dispatch: Delete files older than {timespan}

Maybe someone has worked on this task. I want to delete all files in a folder that are older than two weeks. My approach is to check the creation time of the file and the current time and if the difference is greater than two weeks, delete it.

Is that possible?

SolidworksSolidworks Pdm enterprise Pdm