Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: directories only
TopSrchDir = 'C:\WINDOWS\' nHandle = srchInit(TopSrchDir,"*.*","",0,48)Is this correct if I only want it to recurse to get all directories and below?
Is there a more refined setting to do this, cuz this is really slow? As this picks up files as well as Dirs. I only really want to get all the Dirs.
AddExtender("wsrch34I.dll") TopSrchDir = 'C:\WINDOWS\' nHandle = srchInit(TopSrchDir,"XXXXXXX.XXXX","",0,48) while 1 xxx=srchNext(nHandle) if xxx=="" then break pause("Found",xxx) endwhile srchFree(nHandle) message("All","Doned")Part of the trick is the XXXXXXXX.XXXX mask that should match NO files, so all you should see is directories.
I've attached my code, which doesn't work. I think I'm in the ballpark, but the synapses have not yet responded to the caffeine.
If AddExtender("WSRCH34I.DLL") == @FALSE Then Message("Error", "There's a problem with WSRCH34I.DLL.") drives = DiskScan(2) ;Tell us all the user's local drives drvnum = ItemCount(drives,@tab) ;How many local drives are there? BoxOpen("Searcher", "Initializing...") For d = 1 To drvnum drv = ItemExtract(d, drives, @tab) ;Start searching 1st drive volume drvroot = StrCat(drv,"\") ;Gimme the root handle=srchInit(drvroot, "XXXX.XXX", "", 0, 48) ;Need a handle While 1 hit = srchNext(handle) ;Let's go searching If hit == "" ;We're outtahere if we come up empty-handed Break Else BoxText(hit) if strupper(hit)==strupper("C:\My Download Files\") then Message("Found", hit) EndIf EndWhile Next srchFree(handle)
Article ID: W12559
Filename: Searcher - How to get Directories only.txt
File Created: 2017:07:28:12:58:30
Last Updated: 2001:03:01:14:34:44