forfiles

forfiles is a computer software utility for Microsoft Windows, which selects files and runs a command on them.

It became a standard utility with Windows Vista, as part of the new management features.

Sequences of the form 0xFF, where "0x" is literal, and "FF" represents any two-digit hexadecimal number, are replaced with the corresponding single-byte value.

Using the 0x sequence form described previously, 0x22 can also be used, which additionally hides the " from the command interpreter.

The following command selects all log files (*.LOG) in the Windows directory 30 days or older, and lists them with their date.

The use of CMD /C is required in the above examples, as both ECHO and DEL are internal to the command processor, rather than external utility programs.