Deleting a directory and all subdirectory lazarus / 31-LCL ---------------------------------------------------------------------- BlueIcaro · 2010-09-18 23:36 Hello, how can I read a folder and the subfolders, to delete the files inside and the folders? /BlueIcaro ---------------------------------------------------------------------- typo · 2010-09-18 23:44 Code: [Select]RemoveDir(DirNameString); Removes an empty Dir. ---------------------------------------------------------------------- captian jaster · 2010-09-19 00:29 Quote from: typo on September 19, 2010, 01:44:24 amCode: [Select]RemoveDir(DirNameString); Removes an empty Dir. He wants to know how to delete a folder with content... @OP Use FindFirst/FindNext/FindClose to delete files in the folder then the folder... You can probably find a far better way to do this..... ---------------------------------------------------------------------- bonmario · 2010-09-19 05:43 Code: [Select]      Result:=DeleteDirectory(NomeDir,True);       if Result then begin         Result:=RemoveDirUTF8(NomeDir);       end; DeleteDirectory delete the content. A t the end, if all is ok, RemoveDirUTF8 delete the folder. Hi, Mario ---------------------------------------------------------------------- BlueIcaro · 2010-09-19 07:31 Thank you bonmario for the example, it's works nice. Also Thank you Captain Jasper for your anwser too. /BlueIcaro