Delete a folder with all files in it (Views: 28)
Problem/Question/Abstract: How to delete a folder with all files in it Answer: procedure DeleteFolder(Dir: string); var fos: TSHFileOpStruct; begin ZeroMemory(@fos, SizeOf(fos)); fos.wFunc := FO_DELETE; fos.fFlags := FOF_SILENT or FOF_NOCONFIRMATION; fos.pFrom := PChar(Dir + #0); if ShFileOperation(fos) = 0 then ShowMessage('Successful'); end; |