Hi...
I have googled around for the easiest way to delete a directory, including all files below it, but there are so many to choose from.
I have tried some of them, but they dont seem to work for some reason.
The dir I want to delete only contains files, and no directories underneat.
How can I do this? Do I have to use findfirst/findnext etc?
Roald
Norway.
Comments
:
: I have googled around for the easiest way to delete a directory,
: including all files below it, but there are so many to choose from.
: I have tried some of them, but they dont seem to work for some
: reason.
:
: The dir I want to delete only contains files, and no directories
: underneat.
:
: How can I do this? Do I have to use findfirst/findnext etc?
:
: Roald
: Norway.
One of the easiest ways is to use ShellExecute() and let DOS handle the deletion.
The better way is to use FindFirst()/FindNext() to loop through the filenames and use DeleteFile() to remove them. Then you can use RemoveDir() to remove the directory itself.