I\'m working on a batch script that will let me delete files older then a set period using forfiles. For now, I\'m aiming at printing the files that will be deleted.
dir *.* > C:\path\dummy%date:~4,2%%date:~7,2%%date:~10,4%.DAT
dir *.* > C:\path\dummy%date:~4,2%%date:~7,2%%date:~10,4%.csv
forfiles -p C:\path\ -m *.DAT /d -50 /c "cmd /c del /Q @path"
forfiles -p C:\path\ -m *.csv /d -50 /c "cmd /c del /Q @path"
Replace the .dat and .csv files what u want to delete.
-50 delete older then 50 days
This is the windows batch file