[Table of Contents]

Example for a quick start

The following example should help you understand what you can do with ALL.

Each example shows a sample command line and explains what the command line portions represent.

The following ALL command creates a subdirectory in the root directory of the current drive for each file name that it extracts from the records in FILES.DAT. It then extracts he contents of an archive file with the same name on a diskette in drive A into the newly created directory.

All FILES.DAT /t "md \!fn! & cd \!fn! & unzip A:\!fn!"
|     |       |  |                                   |
+-- command   |  +-----------------------------------+
      |       |                     |
      +-- input file         command template
              |
              +-- test mode

In the example above ALL reads a file called FILES.DAT. This file might contain full or partial file specifications. Its contents might be the following:

ABC.ARC
C:\TOOLS\DEFGHIJK.ARC
LMNOP.ARC
D:\QRSTUVW.ARC
XYZ.ARC

For each line in the file ALL constructs three commands to be executed.

The ALL command shown above could be read as follows:

For each line in file FILES.DAT do this:

  1. Analyze the line and determine the portions of the file specification, i.e. on DOS: drive, directory, name and extension.

  2. Then create a directory (MD command) with the same name as the file name (!fn!) contained in the file specification. Then change to this directory (CD command).

    The ampersand character (&) separates commands from each other.

  3. Extract all files (UNZIP) from a file on drive A (A:) with the same name as the file name portion found in the current line (!fn!) to a first level directory with this very name on the current drive (\!fn!). (This directory was created by executing the first command.) The commands constructed would not be executed, however, because the /t (test) option was specified. This option allows you to see what the commands built would look like before you execute them.

The output generated by ALL would be the following for the given example:

md \ABC
cd \ABC
unzip A:\ABC
md \DEFGHIJK
cd \DEFGHIJK 
unzip A:\DEFGHIJK \DEFGHIJK
md \LMNOP
cd \LMNOP 
unzip A:\LMNOP
md QRSTUVW 
cd QRSTUVW
unzip A:\QRSTUVW
md \XYZ 
cd \XYZ
unzip A:\XYZ
[Table of Contents]