I have several folders on a server that contains files that go back 3-4 years. It was mentioned that keeping files that long is no longer needed. So my question is, is there a way to create a windows service in C# that can delete files in the folders that are older then 12 months?
The server is structured something like this:
DataLogs
Server1
App1 - this folder contains all the log files
or it can look something like this:
DataLogs
Server1
App1
Logs - the log files can be stored here
and another example:
DataLogs
App1 - logs stored here.
So is there a way to do a 'high level' search and delete all files that are older then 12 months or do I have to go through every folder and look? How would that be accomplished?