procedure DeleteDir(const Path: string);
var
DirName: string;
FileOp: TSHFileOpStruct;
begin
DirName:=Path+'/*.*'+#0;
with FileOpdo
begin
Wnd := 0;
wFunc := FO_DELETE;
pFrom := PChar(DirName);
pTo := nil;
fFlags := FOF_Silent + FOF_NoConfirmation;
fAnyOperationsAborted := False;
hNameMappings := nil;
lpszProgressTitle := nil
end;
SHFileOperation(FileOp);
RemoveDir(Path)
end;