1、如何判断目标文件夹里面是否有某名字(比如新建文件夹1)的文件夹? if 有此文件夹(新建文件夹1) then exit else 没有 then 新建此名字的文件夹 2、我用函数WinExec('xcopy c:\test\*.txt d:\temp\', SW_HIDE)批量复制文件的时候,如何判断目标文件夹里是否有同名字的文件?我希望有的话就替换。
procedure TForm1.Button1Click(Sender: TObject);
begin
if not DirectoryExists('c:\temp') then
if not CreateDir('C:\temp') then
raise Exception.Create('Cannot create c:\temp');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if not DirectoryExists('c:\temp') then
if not CreateDir('C:\temp') then
raise Exception.Create('Cannot create c:\temp');
end;