Joseph Michael Pesch
VP Programming

Windows Command ForFiles to Search Folders/Sub-Folders and Output File Details

by 22. October 2012 12:23

Below is a sample command to search a folder (/p) and all subfolders (/s) for files mathing *.zip (/m)
and run echo command (/c) to print the filename, size, date and time to a text file

forfiles /p c:\foldertosearch /s /m *.zip /c "cmd /c echo @file;@fsize;@fdate @ftime" > output.txt

See Microsoft site for full usage of forfiles:



Comments are closed