I am looking for a way to delete all files older than 7 days in a batch file. I\'ve searched around the web, and found some examples with hundreds of lines of code, and oth
For windows 2012 R2 the following would work:
forfiles /p "c:\FOLDERpath" /d -30 /c "cmd /c del @path"
to see the files which will be deleted use this
forfiles /p "c:\FOLDERpath" /d -30 /c "cmd /c echo @path @fdate"