Delphi2: Dateien löschen

Hallo!

Ich suche unter Delphi2 einen Befehl ähnlich dem DOS-Befehl „del *.*“ , um mehrere Dateien auf einmal löschen zu können.
Bis jetzt habe ich nur die Möglichkeit gefunden, jede Datei einzeln zu löschen, was aber auf Dauer zu umständlich ist.
Wer kann mir da weiterhelfen?

Danke

Sylvia

Da gibt eine API-Proc (win32)

kommst sicher mit dem englischen original-text klar. Funktioniert wunderbar und zeigt sogar die (original) Windows-Dialoge mit animationen wenn’s länger dauert.

The following example demonstrates using the SHFileOperation
function to copy a group of files and display a progress dialog. You
can also use the following flags to delete, move and rename a
group of files.

TO_COPY
FO_DELETE
FO_MOVE
FO_RENAME

Note: The buffer that contains the file names to copy must
end with a double null terminating character;

Example:

uses ShellAPI;

procedure TForm1.Button1Click(Sender: TObject);
var
Fo : TSHFileOpStruct;
buffer : array[0…4096] of char;
p : pchar;

begin
FillChar(Buffer, sizeof(Buffer), #0);
p := @buffer;
p := StrECopy(p, ‚C:\DownLoad\1.ZIP‘) + 1;
p := StrECopy(p, ‚C:\DownLoad\2.ZIP‘) + 1;
p := StrECopy(p, ‚C:\DownLoad\3.ZIP‘) + 1;
StrECopy(p, ‚C:\DownLoad\4.ZIP‘);

FillChar(Fo, sizeof(Fo), #0);
Fo.Wnd := Handle;
Fo.wFunc := FO_COPY;
Fo.pFrom := @Buffer;
Fo.pTo := ‚D:‘;
Fo.fFlags := 0;
if ((SHFileOperation(Fo) 0) or
(Fo.fAnyOperationsAborted false)) then
ShowMessage(‚Cancelled‘)
end;

[Bei dieser Antwort wurde das Vollzitat nachträglich automatisiert entfernt]