C:\WINDOWS\system32\forfiles.exe /p C:\logs /s /m *.log /d -7 /c "CMD /C del @FILE"
This example recursively deletes "*.log" files older than 7 days. If you simply wanted to move the files, change the comannd parameter - this provides a nice way to archive.
For further information, see the Forfiles documentation.
No comments:
Post a Comment