Using the ForFiles Utility
The ForFiles utility provides a means of looping through a list of files and performing actions on
those files one at a time. For example, you might want to process all files that someone has changed
since a certain date. In most respects, this loop method works precisely the same as the For com-
CREATING BATCH FILES 139
mand described in the ???Using the For Command??? section of the chapter. This command uses the
following syntax:
FORFILES [/P pathname] [/M searchmask] [/S] [/C command]
[/D [+ | -] {MM/dd/yyyy | dd}]
The following list describes each of the command line arguments.
/P pathname Specifies the starting point for a search. The path is the starting folder in the
search. The default setting uses the current directory as the starting point.
/M searchmask Defines a search mask for the files. You can use the asterisk (*) and question
mark (?) as wildcard characters, just as you would when using the Directory command. The
default setting searches for all files in the target directory.
/S Searches all of the subdirectories of the specified directory.
/C command Specifies the command you want to execute for each file.
Pages:
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377