文件夹拷贝 子文件及文件夹

时间:2021-11-27 21:35:36
function TForm1.CopyPath(BasePath,TargetPath:string):Boolean;
var
  i:Integer;
  cmd:string;
begin

    cmd:='echo d | Xcopy '+BasePath+' '+TargetPath+' /s/e';
    ShowMessage(cmd);
    i:=ShellExecute(Handle,nil,'cmd.exe',PChar('/K '+cmd),nil,SW_HIDE);
    if i>32 then Result:=True else Result:=False;
end;