Hallo Rene,
versuche es einmal so:
Delphi-Quellcode:
function CopyFiles (const fromDir, toDir: string): Boolean;
var
fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do
begin
wFunc := FO_COPY;
// fFlags := FOF_FILESONLY;
fFlags := 0;
pFrom := PChar(fromDir + #0);
pTo := PChar(toDir)
end;
Result := (0 = ShFileOperation(fos));
end;
procedure TForm1.Button1Click (Sender: TObject);
begin
CopyFiles ('C:\Source\*.*', 'C:\Target');
end;
Beachte die Wildcards bei der Angabe der Quelldaten.
Gruß Hawkeye