Name

forfilesRK

Synopsis

forfiles [selection-options] [-c"command"]

Perform a command on each file in a list. (The default action is to display the filename.)

Options

-c "command "

Specify the command to execute. The following case-sensitive constructs are available for use within commands:

@FILE

Current filename

@FNAME_WITHOUT_EXT

Bare filename

@EXT

File extension

@PATH

Directory location of fil

@RELPATH

Directory location of file, relative to the current directory

@ISDIR

TRUE /FALSE as appropriate

@FSIZE

File size

@FDATE

File modification date:yyyymmdd

@FTIME

File modification time:hhmmss

The default command is cmd /c echo @FILE.

-pdir

Specify the directory location at which to start the search (the default is the current directory).

-m string

Select the files matching the specified string, which may contain wildcards (the default is *.*).

-d+ |-ddmmyyyy | n

Select the files last modified on the specified date, or before (-) or after (+) it. If a number is given instead of a date, select the files modified (-)/not modified (+) within the last n days.

-s

Recurse subdirectories.

-v

Verbose output mode.

Get Windows 2000 Commands Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.