Forfiles Command In Windows Server 2008

This article describes Forfiles command in windows server 2008 operating system and also explains its syntax.
  • 2687


Forfiles command in Windows Server 2008 is used to selects and executes a command on a file or set of files. Forfiles command is also used for batch processing. Syntax used for Forfiles command is given below.


forfiles [/p <Path>] [/m <SearchMask>] [/s] [/c "<Command>"] [/d [{+ | -}][{<Date> | <Days>}]]

Parameters For Forfiles

Parameter Description
/p <Path> Defines the path from which to start the search.
/m <SearchMask> Searches files according to the specified search mask.
/s Instructs the Forfiles command to search into subdirectories recursively.
/c "<Command>" Runs the specified command on each file.
/d [{+|-}][{<Date>|<Days>}] Select a file with a last modified date within the specified time frame.
/? Shows help at the command prompt.

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.