Is there a way to automate searching multiple specific folders rather than searching My Computer?
Say you have three different folders each on a separate network drive. Is it possible to key in the file name once that you are looking for and see the results sorted by the folder they are contained in? Searching the whole network takes time where specific folders return results faster.
Thanks,
Rory
Searching for files in specific folders
Moderators: Dorian (MJT support), JRL
The quick answer is yes. But it requires programming this.Is there a way to automate searching multiple specific folders rather than searching My Computer?
One method would be to issue the DOS command
dir {file spec} /S >outputfile.txt
in each of the respective folders
and then parse the outputfile.txt to see if you have any hits.
It is possible to make these searches occur in parallel to make it even faster.
The first "dir" command creates outputfile.txt because of the single ">"
redirection. Subsequent commands can specify ">>" and this will append to the the existing file.
Hope this gives you some ideas where to start.
Here is a simple sample which works for me.
Code: Select all
Let>Folder1=c:
Let>Folder2=x:
Let>Folder3=I:\TestDeliverables
Let>FileSpec=setup.log
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0
Let>RP_DISPLAYERROR=1
RunProgram>cmd /c dir %Folder1%\%FileSpec% /s >c:\searchresult.txt
RunProgram>cmd /c dir %Folder2%\%FileSpec% /s >>c:\searchresult.txt
RunProgram>cmd /c dir %Folder3%\%FileSpec% /s >>c:\searchresult.txt
ReadFile>c:\searchresult.txt,result
MessageModal>result