I don't think we can ever say good by to our good old MS-DOS. My first intimate interaction with Micro Computer(the original name of PC ) was through MS-DOS. Now in the advanced age of computer still I am using DOS, this time as part of one the build scripts. Our continuous integration creates an installer every night(early morning to be exact – this is a cheat, I'll describe it later). We want to keep them for 2 weeks and delete afterwards. Now to do this I can create a simple .net console app, which will be more efficient in error handling etc. But I like to do it in the good old way :).
Found a command line utility –ForFiles- comes with WinXP command line.
(If you don't have installed by default – in most of the case no- you can download it from the MS FTP server. You may want to place it to C:\WINDOWS\system32 or update the PATH variable accordingly)
forfiles -p "C:\SearchFolder" -s -m*.msi -d-14 -c "cmd /c del @path"
-p : path to search for
-s : include subdirectories
-m : search mask (*.msi files here)
-d : files older than days (14 in my case), you can use dates instead
-c : the command to execute on the files
also checkout the help for 'forfiles'. If you have forgotten how to do it, its forfiles/?... uh it doesn't work ? simply type forfiles :)
The following variables can be used in Command : (@path is already used in the above example)
@FILE, @FNAME_WITHOUT_EXT, @EXT, @PATH, @RELPATH, @ISDIR, @FSIZE, @FDATE, @FTIME
hope this helps...
edit
found a nice website with WinXP command lines