Multiple Wildcards With DIR
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   There are times when we want to display a directory listing that 
includes only specified files, but the files we want to see can't be 
selected using a single wildcard. For example, suppose you forget the name 
of a command, and you want to display a list of all executable files 
(*.BAT, *.COM and *.EXE) in the current directory to jog your memory. With 
a simple batch file, DOS lets you do this. The following batch file 
accomplishes just the trick (and it sure beats typing DIR *.BAT, DIR *.COM 
and DIR *.EXE consecutively):

@ECHO OFF
:START
IF "%1"=="" GOTO END
DIR %1
SHIFT
GOTOSTART
:END

   Enter the batch file using COPY CON of a text editor, saving it as 
D.BAT or any other name you think appropriate. To use it, just type D 
followed by any wildcard specifications (separate multiple parameters with 
spaces) you desire and press ENTER. For example, the command

      D *.BAT *.COM *.EXE

shows all the executable files in the current directory.

   One drawback to D.BAT is that you get separate directory listings for 
each parameter supplied. If you are interested only in the filenames 
without the header and footer information normally produced by DIR, change 
DIR %1 to DIR /B %1 in the batch file. You can also use DIR /B /W %1 for a 
list of only the filenames in multiple columns.

   If you use NDOS and 4DOS, you can use a very short alias to accomplish 
the same task as D.BAT:

      ALIAS D=FOR %%I IN (%%1&) DO DIR /K /M %%1

This version lists one file per line without the header and footer 
information, but also prints the size, date and time of each file.

-=--------------        -=*=-     -=*=-     -=*=-        --------------=-
