Forfiles is a little known command that is great for iterating over a number of files that meet a condition, it's available in both 2000, XP and 2003 but there are different versions out there depending on servicepack version.
For example, I use it in a backup script to remove local backups when they have been moved to network drive:
' Delete cab files older than 3 days in local folder
oWshShell.Run "FORFILES /p ""C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup"" /m *.cab /d -3 /c ""cmd /c del @file""" , 0, True
For all command line options run FORFILES /? on the command prompt.