Link to home
Start Free TrialLog in
Avatar of nigecooper
nigecooper

asked on

Copying files from Network drive to network drive using UNC paths

Whats the best way to copy files from a network drive using UNC paths?

I want to give the user feed back in the form of a progress bar or the 'flying file' windows animation?  

I also want to make sure that the copied worked ie. Check for a result code.

Any help please.
ASKER CERTIFIED SOLUTION
Avatar of alijunior
alijunior

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alijunior
alijunior


Like above, use SOurce and Dest like in Windows Explorer.

To verify the copied files here, you can use TFileStream and compare values.

...

uses ShellAPI;

procedure ShellFileCopy(Source, Dest : String);
var Dados: TSHFileOpStruct;
begin
  FillChar(Dados,SizeOf(Dados), 0);
  with Dados do
  begin
    wFunc := FO_COPY;
    pFrom := PChar(Source);
    pTo := PChar(Dest);
    fFlags:= FOF_ALLOWUNDO;
  end;
  SHFileOperation(Dados);
end;

The good point of this way are:

You can use wildchar.
Windows, with a floppy, detects diskfull and ask for another.
Windows shows a default system prograss bar, like explorer.

SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial