I use this code to delete whole directories:
uses
ShellApi;
function DelDir(dir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_DELETE;
fFlags := FOF_SILENT or FOF_NOCONFIRMATION;
pFrom := PChar(dir + #0);
end;
Result := (0 = ShFileOperation(fos));
end;
Are there any flags I can set to allow for permanent removal of deleted directories?
By permanent removal, I mean it won't show up in the recycle bin after it is deleted because this is what happens when I use the DelDir Function.