Using FOR to perform an operation on a file collection

1 March 2002 by Snakefoot | Comment » | Trackback Off
The FOR command allows one to specify a file wildcard (*.txt) and what operation to perform on each file that matches the wildcard (type).

When using the FOR loop directly from the command prompt:

FOR %f IN (*.txt) DO type %f

When using FOR inside af batch file:

FOR %%f IN (*.txt) DO type %%f

Related Create your own file find utility using FOR

More Info MS KB Q68268
More Info MS KB Q75634
More Info MS KB Q134572
Tags:
Category:

Updated: 23 September 2007

Leave a comment


NB! Use the Forum for computer help and off-topic questions.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>