set safety off mypath=GETDIR() IF EMPTY(mypath) RETURN .T. ENDIF =getfolders(mypath) IF !DIRECTORY(mypath) RETURN .T. ELSE MESSAGEBOX("could not delete the directory: "+mypath) ENDIF function GetFolders parameters mypath local lstfiles[1], dirnum,i ? mypath dirnum = adir(lstfiles,mypath+"\*.*","D") for i = 3 to dirnum if "D"$lstfiles(i,5) GetFolders(mypath+"\"+lstfiles(i,1)) endif next on error do fileerror delete file (mypath+"\*.*") rd (mypath) on error return(.t.) PROCEDURE FILEERROR myError = 1 RETURN