Archive: Delete files older than a certain date


Delete files older than a certain date
As part of our install process, we have a utility that backs up our database info, and some report files. When installing our new product, we only need to keep report files that are less than a year old, and removing the older files speeds up our install significantly.

Is there a way to delete files out of a directory based on a wildcard search, and could they be searched quickly using their creation dates?


I think you should be able to use the Locate macro. This same documentation is also included in your NSIS help file.


But locate can only really find files based on their existence or size.

Would you suggest trying to use something like the Time plugin in the callback function? That would mean the callback would be used on every file, and that seems pretty inefficient.


a Locate / GetTime combo should do it