Forfiles

Selects and executes a command on a file or set of files. This command is useful for batch processing.

forfiles can be for instance used to periodically delete all files older than X days from a specific directory

<br /> forfiles -p &#8220;c:tmp&#8221; -s -m *.* -d -3 -c &#8220;cmd /c del @FILE&#8221;<br />
This command will remove all files older than 3 days (-3) from directory c:tmp
It is not part of the normal distribution of Windows, but it can be downloaded from Microsoft Technet

Related Posts