Title : Enumerations on the Dos command line Author: Daniel Trembath, 12 July 2002 Edited: same Keywords: enumeration batch files advanced dos Ok ok, enumerations is a little excessive a title. Every wanted to write a batch file, or run a command in DOS that affected every file in a directory? Try using a 'for' loop. for %i in (*.txt) do aCommand %i This is a for loop that will get every file that matches the pattern *.txt (text files in this case) and will 'do' the aCommand (whatever command you like) to it. So say if you wanted output the content all the text files in a directory you might run: c:\somedir\>type aFile.txt c:\somedir\>type bFile.txt c:\somedir\>type cFile.txt you can instead run: c:\somedir\>for %i in (*.txt) do type %i Now of course you could have just as easily typed: c:\somedir\>type *.log But that's not nearly as fun. And its also a bad example. This will come in handy :) Cheers Daniel