Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Dir name wildcard DirExist recurse
Something like this....
If AddExtender("WSRCH34I.DLL") == @FALSE Then Message("Error", "There's a problem with WSRCH34I.DLL.") dirname="*net*" ;wildcarded dirname to find!!!!!! drives = DiskScan(2) ;get all local drives drvnum = ItemCount(drives,@tab) ;How many local drives are there? BoxOpen("Directory searcher","") For d = 1 To drvnum drv = ItemExtract(d, drives, @tab) ;extract each drive volume on at a time drvroot = StrCat(drv,"\");Gimme the root handle=srchInit(drvroot, "", "", 0, 48);Need a handle BoxTitle("Searching %drvroot% for %Dirname%") While 1 hit = srchNext(handle) ;Let's go searching if hit == "" then break ;We're outtahere if we come up empty-handed BoxText("filename :%hit%") lastslash=StrSub(hit,strlen(hit),1) if lastslash=="\";Dir found tempslash=StrIndexNC(hit,"\",strlen(hit)-1,@BACKSCAN) founddir=StrSub(hit,tempslash+1,strlen(hit)-tempslash-1) BoxText("Dirname :%hit%") ;Finds wildcarded text within a larger string.. if StrIndexWild(founddir, dirname, 1) Message("Directory Found", hit) endif EndIf EndWhile srchfree(handle) Next :Cancel exit
Article ID: W14611
Filename: Recursive directory name search.txt
File Created: 2001:03:01:14:39:48
Last Updated: 2001:03:01:14:39:48