>ADIR(aFileList, "d:\ahsan\TEMP\*.DBF") && I changed it > >FOR i = 1 TO ALEN(aFileList, 1) > > cTable = aFileList[i, 1] > USE (cTable) ALIAS TestTable IN 0 > iRecords = RECCOUNT("TestTable") > USE IN TestTable > > IF (iRecords = 0) > DELETE FILE ("d:\ahsan\TEMP\" + cTable) > ENDIF > >ENDFOR >If that still produces an error, then you might have to step through the debugger to see where the problem is. You should be on the right track, though.