Delphiran - Delphi Tips Question : How can I
delete a directory and all his subdirectories ?
Answer : DeleteAllFiles() will delete a set of files or
a directory of your choice and place them in the Recycle Bin. It also displays
the same animation of the operation as does Windows Explorer. You can pass
wildcards to the function. In order to delete a directory, do not include the
last backslash. For example: DeleteAllFiles('C:\ThisDirectory');
uses ShellAPI;
function DeleteAllFiles(FilesOrDir: string): boolean; {
Sends files or directory to the recycle bin. } var F:
TSHFileOpStruct; pFromc: array[0..255] of Char;
Resultval: integer; Dir: string; begin { This, for
some reason, fixes the AV that occurs when } { the directory doesn't exist. } Dir
:= ExtractFilePath(FilesOrDir);