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 And Folder Extender

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

Exclude Directory

 Keywords: FAF Exclude Skip Directory fafOpen fafFind ItemRemove Trick   

;***************************************************************************
;**
;**           FAF Exclude Directory Trick
;**
;** Purpose:  The FAF Extender doesn't offer an option to Exclude directories
;**           during the search. This code simply removes matching directories
;**           from the resulting list.
;**
;**           This code sample locates all .PST files NOT located in the users
;**           Personal Documents folder.
;**
;** Inputs:   sExcludeDir
;** Outputs:  FAFFind results excluding all diretories matching sExcludeDir
;** Revisions: 1.0 Deana Falk 20140319
;**
;***************************************************************************
AddExtender('WWFAF44I.DLL', 0, 'WWFAF64I.DLL')

sExcludeDir =  ShortCutDir('personal' , 0 , 1 )

fsRecurse = 16  ; Look in sub directories
fsNoReparse = 128 ; Ignore reparse points.

; Open a search handle
BoxOpen('Find Outlook PST files', 'Inititalizing...')
fsHandle = fafOpen("c:\", "*.pst", fsRecurse|fsNoReparse)
nCount = 0
sList = ''
While 1
   sFound = fafFind(fsHandle)
   If sFound == "" Then Break
   nCount = nCount + 1
   BoxTitle(nCount)
   BoxText(sFound)
   If sList == '' Then sList = sFound
   Else sList = sList:@TAB:sFound
EndWhile
If nCount == 0
   Message("Search Error", nCount:" files found")
   Exit
EndIf

; Locate and remove exclude dir from fafFind results
For x = 1 To nCount
   sFile = ItemExtract( x, sList, @TAB )
   If StrIndexNC(sFile,sExcludeDir,0,@FWDSCAN)
      sList = ItemRemove( x, sList, @TAB )
   EndIf
Next

AskItemlist('Outlook PST files', sList, @TAB, @UNSORTED, @SINGLE)
fafClose(fsHandle)
Exit

Article ID:   W17571
Filename:   Exclude Directory.txt
File Created: 2014:03:19:09:33:26
Last Updated: 2014:03:19:09:33:26