MS DOS script to rename, append date, delete files older than 30 or N days

If you use Windows Server 2003 built-in NTBackup, you may need to move daily backup files into an archive folder, and delete old files.  Here is a script to rename and append time/date to backup file, move it to an archive directory, and search and delete all files older than 30 days.

ren E:\ntbackup\backup2.bkf backup1_%date:~4,2%%date:~7,2%%date:~10,4%_.bkf
move E:\ntbackup\backup?_* E:\ntbackup\archive
forfiles /P “E:\ntbackup\archive” /S /M *.bkf /D -30 /C “cmd /c del @PATH”

Set this as a scheduled task after your NTBackup job completes, and you should be good to go with basic full backup.