Batch Files - Purging Files in a Folder
This is how to do a simple folder purge operation
Purging files in a folder
forfiles -p "C:\what\ever" -s -m *.* /D -<number of days> /C "cmd /c del @path"
For example
Display files to be deleted
forfiles -p "C:\what\ever" -s -m *.zip /D -20 /C "cmd /c echo @FILE"
Do the actual delete
forfiles -p "C:\what\ever" -s -m *.zip /D -20 /C "cmd /c del @FILE"