Files Delphi

Title: Delete a directory without any confirmations
Question: How can I delete a directory and his sub-directories without any confirmations?
Answer:
uses ...,ShellApi
function TDM.DeleteTree(SrcPath: String): Boolean;
var
FileOpStruct: TShFileOpStruct;
begin
FileOpStruct.Wnd := Application.Handle;
FileOpStruct.wFunc := FO_DELETE;
FileOpStruct.pFrom := PChar(SrcPath);
FileOpStruct.pTo := Nil;
FileOpStruct.fFlags := FOF_NOCONFIRMATION or FOF_SILENT or FOF_NOERRORUI;
FileOpStruct.lpszProgressTitle := Nil;
Result := ShFileOperation(FileOpStruct) = 0;
end;