I have been looking for a routine that will find all the occurrences of a file in a directory tree, but there are no QuickWin functions that are useful. At first I successfully used the DOS command
dir filename /b/l/s/o:n /a:-d >c:dirlist.txt'
called by SYSTEMQQ. This works well and with wildcards, but flashes up a DOS box whilst searching.
I then wrote a successful recursive routine FindFileinTree using the WIN APIs FindFirstFile and FindNextFile ? but I am still working on the wildcards side of it.
Then I chanced upon SearchTreeForFile in imagehlp.dll. This is not one for which CVF has an interface ? indeed I cannot even find it in either of JR Simon?s API Superbibles. I applied my considerable degree of ignorance of WIN APIs to hacking a working interface for it, and found that it will only find the first occurrence of a file, and does not work with wildcards.
Does anyone know if it is possible to use SearchTreeForFile or any other similar routine to find all the occurrences of a file in a tree?
Bear of little brain