Hier im Forum gefunden.
Falls es auch was anderes als kopieren per cmd.exe sein darf.
Delphi-Quellcode:
function TForm1.SHCopyFile(
Handle: THandle; szSource, szDestination: TFileName): Boolean;
var
ShellFileOperation: TSHFileOpStruct;
begin
Result := True;
try
with ShellFileOperation
do
begin
Wnd :=
Handle;
wFunc := FO_COPY;
pFrom := PChar(szSource);
pTo := PChar(szDestination);
// fFlags := FOF_FILESONLY OR FOF_NOCONFIRMMKDIR FOF_SIMPLEPROGRESS;
fFlags := FOF_NOCONFIRMMKDIR;
lpszProgressTitle := '
Dateien kopieren ...';
end;
SHFileOperation(ShellFileOperation);
except
Result := False;
end;
end;
procedure TForm1.StartBitBtnClick(Sender: TObject);
begin
if SHCopyFile(
Handle, '
C:\Windows\*.*', '
D:\Windows.Copy\')
then
begin
ShowMessage('
Bingo ... und was funktioniert nicht?');
end;
end;