WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

File Searcher
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Generic Searcher Example to Rummage through Directories to Find a File

Keywords:      searcher

Question:

I've looked at your searcher extender example, but can't get it to find any files except if they're in the root of my C:\ drive. Can you help me out?

Answer:

You need to specify the flag of "16" in the srchinit function, if you want to search recursively through directories, as in the following example:
;==================snip=====================
BoxOpen("File Finder","Initializing")

AddExtender("wsrch34I.dll")

hand=srchInit("C:\","WINBATCH.EXE","","",16)

c=0
fh=FileOpen("c:\temp\whereitis.txt","WRITE")

while 1	  
a=srchNext(hand)	  
  if a=="" then break	
  c=c+1 
  
  dd=FileYmdHms(a)   
  ss=FileSize(a)   
  ee=strfix(c," ",8)   
  dd=strfix(dd," ",22)	 
  ss=strfix(ss," ",12)	 
  line=strcat(ee,dd,ss,a)   
  FileWrite(fh,line)  
  
 ;Display(1,c,a)
endwhile

Message("Find Complete",a)
srchFree(hand)	

exit

Article ID:   W12554
Filename:   Generic Searcher Ex to Find a File Recursively.txt
File Created: 2001:03:01:15:33:38
Last Updated: 2001:03:01:15:33:38