You can use
wildcards in a directory command.
For example, lets say you are in the d:\users directory and wanted to find all files beginning with logfileh that were text files. You could type the following command.
dir logfileh*.txt /s
The "/s" will display results for all subdirectories from the d:\users directory.
If you wanted the results to go to a text file you could use the
append symbol to append the results to a text file. Below is an example of the same command.
dir logfileh*.txt /s > c:\users\copied_logfiles.txt
Like any command line command this command can be added to any batch file.