http://stackoverflow.com/questions/51054/batch-file-to-delete-files-older-than-n-days
This will delete all files in a backup directory older than 3 days:
forfiles -p z:\backup -s -m *.* -d -3 -c "cmd /c del /q @path"
To test it first, this will print out each file that you will be deleting:
forfiles -p z:\backup -s -m *.* -d -3 -c "cmd /C Echo 0x22@Path\@File0x22"
Syntax for Windows 2008:
forfiles /P "C:\Mysql_backup" /S /M *.sql /D -30 /C "cmd /c del @PATH"