From: "Peter Below (TeamB)" <100113.1101@compuXXserve.com> Subject: Re: Deleting Folders. Date: 18 Dec 1999 00:00:00 GMT Message-ID: Content-Transfer-Encoding: 8bit References: <385B7016.80A4E2DE@hedemora.mail.telia.com> Content-Type: text/plain; charset=iso-8859-1 Organization: TeamB Mime-Version: 1.0 Reply-To: 100113.1101@compuXXserve.com Newsgroups: borland.public.delphi.winapi > I an having trouble with recusivly deleting empty folders. I tryed > FileDelete but it seams as it don't work on folders. Do delete a folder you have to use DeleteDirectory and it will fail if the directory is not empty or is the current directory. Use ShFileOperation, it can delete a whole directory tree in one call. Uses ShellAPI; var T:TSHFileOpStruct; begin fillchar(T, sizeof(T), 0 ); with T do begin Wnd:=0; wFunc:=FO_DELETE; pFrom:='E:\Temp\TestDel\*.*'#0; fFlags:=FOF_ALLOWUNDO or FOF_SILENT or FOF_NOCONFIRMATION; end; SHFileOperation(T); Peter Below (TeamB) 100113.1101@compuserve.com) No replies in private e-mail, please, unless explicitly requested!