home *** CD-ROM | disk | FTP | other *** search
- ---------------------- FOR - Internal Batch Subcommand -----------------------
-
- FOR allows you to execute the same DOS command for each of a group of files.
-
- FORMAT: FOR %%variable IN (set) DO command
-
- REMARKS:
-
- %%variable - sequentially assigned to each file in "set" to allow "command"
- to be performed for each file. "Variable" must be a single
- letter.
- set - is one or more file specifications of the form d:filename.ext.
- Global characters (* and ?) are allowed. Path names are not
- allowed.
- command - the DOS command to be performed for each file in "set." The
- command cannot be another FOR Subcommand.
-
- EXAMPLE:
-
- The following batch file displays (via the TYPE command) the contents of the
- files FILE1, FILE2 and FILE3:
-
- FOR %%f IN (file1 file2 file3) DO TYPE %%f