I am trying to write a batch that will look thru a directory of folders called "history" and delete contents in it that are more 7 days old, that is rooted in the C:\test directory.
so far I have this:
for /r %folder% %%A in (.) do If %%~nA equ history (find * -type f -mtime +7)
This does a good job of going to the "history" folders, but I am having a hard time with the delete parameter, as I cant find anything that will look at modified time of the files. Researching on the internet i found many references to this "find" statement that has a parameter -mtime that is supposed to look at modified time, but in the above it is pretty useless. Obviously I am doing something wrong. If you anyone could guide me to the proper command, I would appreciate very much.