

The date argument can be given as a literal date, in MM/DD/YYYY format (other date formats are not accepted). The date switch (/D) selects files based on their last modified date, given a date argument. Directories report a size of the file was last modified, in the localized date format of the current the file was last modified, in the localized time format of the current user. Each path begins with a dot and backslash ( to the literal string TRUE if the matching item is a directory, or FALSE if of the matching item, in bytes.

If the file has no extension, a quoted empty string is path of the matching item, double quoted, including drive letter, and file extension (if of the matching item, double quoted, and relative to the starting directory (given by /P). If a file has multiple extensions, only the last is returned. Variables are technically not required, but must be used if the command is to vary for each name of the matching item, double basename of the matching item (without file extension), double file extension, double quoted, without leading dot. Several variables are provided, to be used in the command as placeholders for the values from each file. Using the 0x sequence form described previously, 0x22 can also be used, which additionally hides the " from the command interpreter. The sequence \" is replaced with a literal quotation mark ". This can be used to embed non-printing ASCII characters, or extended ASCII characters. 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. The command string is executed as given, except as noted below. Suppresses file search/command execution. By default, files are selected regardless of their date.ĭisplays a help message (brief usage instructions). Selects files based on their last modified date. The default command is CMD /C ECHO which causes the name of each matching file to be output (displayed).

See below for the syntax within the command string. The command string typically needs to be wrapped in double quotes. By default, only the single, specified directory is searched.Įxecute the given command for each matching file. Selects matching files in subdirectories. Most DOS/Windows commands will match files with no extension even when given a *.* pattern. The former will only match files with a dot in their name, while the latter will match even those with no dot or extension. This option treats glob patterns *.* and * differently. The pattern must match the entire name, or use wildcards. The file extension is included in the filename the path (folder name) is not. Only files whose filename matches the pattern are selected. UNC paths (\\machine\share) are not accepted.Ī glob pattern (wildcard search). The directory (folder) to search for files in. If no switches or parameters given, it outputs the name of every file in the current directory. The forfiles command has several command-line switches.
#Cmd c del windows#
It became a standard utility with Windows Vista, as part of the new management features. The forfiles command was originally provided as an add-on, in the Windows 98, Windows NT and Windows 2000 Resource Kits. It can be used directly on the command-line, or in batch files or other scripts. The command specifier supports some special syntax options. File selection criteria include name and last modified date.
#Cmd c del software#
com /en-us /windows-server /administration /windows-commands /forfilesįorfiles is a computer software utility for Microsoft Windows, which selects files and runs a command on them.
