Procedure Getfilelist Lparameters lcFileSkeleton,lcAttributes,lcCursor If Pcount()<3 Or Vartype(lcCursor)#'C' lcCursor='curFiles' Endif Do RecurseDirectories With lcFileSkeleton,lcAttributes,.F.,lcCursor Wait Clear Index On fullname Tag filename Index On filesize Tag filesize Index On filepath Tag filepath Go Top *!* Browse Nowait Return Reccount() **************************************** Procedure RecurseDirectories Lparameters lcFileSkeleton,lcAttributes,llKeepDirectory,lcCursor Local Array laDirectory[1,1] Local lnFileCount As Integer Local lnCounter As Integer Local lcCurrentPath As Varchar(200) If Empty(llKeepDirectory) llKeepDirectory = .F. Endif *!* If (!llKeepDirectory) And File('FileDirectory.dbf') *!* Use In Select('filedirectory') *!* Delete File filedirectory.Dbf *!* Endif If !llKeepDirectory Create Cursor (lcCursor); (fullpath Varchar(200),filepath Varchar(200),filename varchar(80), ext varchar(4), filesize Integer,fullname Varchar(100), ModiDate Date, ModiTime Char(16), FileAttr Char(6)) Endif If Empty(lcFileSkeleton) lcFileSkeleton = '*.*' Endif If Empty(lcAttributes) lcAttributes = 'DHS' Endif lnFileCount = Adir(laDirectory,lcFileSkeleton,lcAttributes) lcCurrentPath = Justpath(lcFileSkeleton) Wait 'Processing: '+substr(lcCurrentPath, 1, 200)+'..hang on!' Window Nowait If lnFileCount > 0 For lnCounter = 1 To lnFileCount If !Empty(Strtran(laDirectory[lncounter,1],'.','')) If 'D' $ laDirectory[lncounter,5] && directory - need to recursively call! RecurseDirectories(Addbs(lcCurrentPath)+Addbs(Trim(laDirectory[lncounter,1]))+Justfname(lcFileSkeleton),lcAttributes,.T.,lcCursor) Else Insert Into (lcCursor) (fullpath, filepath,fullname,filename, ext, filesize,ModiDate,ModiTime,FileAttr); Values (Addbs(lcCurrentPath) + laDirectory[lncounter,1],lcCurrentPath,laDirectory[lncounter,1],Juststem(laDirectory[lncounter,1]),Justext(laDirectory[lncounter,1]),laDirectory[lncounter,2],laDirectory[lncounter,3],laDirectory[lncounter,4],laDirectory[lncounter,5]) Endif Endif Endfor Endif && lnFileCount > 0 Return && recursedirectories Return && getfilelistand it worked much, much faster.