Recursively delete old files in Windows

The following command will recursively delete files older than X number of days:

forfiles -p "C:\PATH\TO\FILES" -s -m *.* /D -[number of days] /C "cmd /c if @isdir==FALSE del @path"
Was this answer helpful? 0 Users Found This Useful (313 Votes)