**We are currently moving to a new host. Please pardon any errors!**
BAT Windows delete files older than X days | Debugge
 

BAT Windows delete files older than X days

I found this useful and knew I needed to share. This utilizes the FORFILES command.

echo off
 
rem First Delete old SQL Backup Files
 
FORFILES /p "DIRECTORY" /s /m *.* /d -DAYS /c "CMD /C del /Q @FILE"
 
rem pause

Instructions:

DIRECTORY: Change the directory for the directory you want the script to check
DAYS: Change that for the X amount of days you want it to check

Original source:

http://forums.webhostautomation.com/showpost.php?p=129664&postcount=1

Author:  Crimm

Software engineer (PHP, Bat, VBS), Sr. Systems Admin, Techie, Father, Gamer, Anime watcher (Wannabe Otaku), & full of geek!