Site hosted by Angelfire.com: Build your free website today!

MS-DOS Internal Commands

The FOR Command

Description:

Runs a specified command for each file in a set of files.

Command Syntax:

FOR %variable IN (set) DO command [command-parameters]

Explanation of Syntax:

%variable specifies a replaceable parameter.
(set) specifies a set of one or more files. Wildcards may be used.
command specifies the command to carry out for each file.
[command-parameters] specifies parameters or switches for the specified command.

To use the FOR command in a batch program, specify %%variable instead of %variable.

Command Use:

This command can be used at the command prompt and in batch files.