Friday, May 29, 2015

Command to recursively delete files older than N days

this command will delete all files inside c:\Folder and subfolders which are older than <Number of Days>

forfiles -p "C:\Folder" -s -m *.* /D -<Number of Days> /C "cmd /c del @path"