Board index » delphi » Making a copy of a directory (including subdirs).

Making a copy of a directory (including subdirs).

Hi.
I have a problem.
I need to make an application that creates a copy of a directory, including
files and subdirs, to a new location on the disk.

HOWTO ???? I havn't got a clue !!!

Please help.

Peter, Denmark

 

Re:Making a copy of a directory (including subdirs).


Well, I found out: Here is how:
--------------------------------

implementation
uses ShellAPI;

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
  FOS :TSHFileOpStruct;
begin
  with FOS do begin
    Wnd := Self.Handle;
    wFunc := FO_COPY;
    pFrom := 'c:\idapi\*.*';
    pTo := 'c:\test';
    fFlags := FOF_NoConfirmMkDir;
  end;
  SHFileOperation(FOS);
end;

Regards, Peter

"Lotte Ottzen Christensen" <i...@nork.auc.dk> skrev i en meddelelse
news:ac5ueg$jir$1@sunsite.dk...

Quote
> Hi.
> I have a problem.
> I need to make an application that creates a copy of a directory,
including
> files and subdirs, to a new location on the disk.

> HOWTO ???? I havn't got a clue !!!

> Please help.

> Peter, Denmark

Other Threads