Author: Senn Marco How to delete a folder with all files in it Answer: 1 procedure DeleteFolder(Dir: string); 2 var 3 fos: TSHFileOpStruct; 4 begin 5 ZeroMemory(@fos, SizeOf(fos)); 6 fos.wFunc := FO_DELETE; 7 fos.fFlags := FOF_SILENT or FOF_NOCONFIRMATION; 8 fos.pFrom := PChar(Dir + #0); 9 if ShFileOperation(fos) = 0 then 10 ShowMessage('Successful'); 11 end;