if not directoryexists(xxx) then ForceDirectories(ExtractFilePath(Application.ExeName)+xxxx);
var dirpath: String; filename: String; filehandle: Integer; begin dirpath:= 'xxxx'; filename:= 'test.txt'; if CreateDirectory(dirPath) then if FileExists(filename) then CopyFile(filename,dirpath,true) else exit else exit; end;
CopyFile('C:\aa.txt','C:\aa\aa.txt',True);
ForceDirectories(ExtractFilePath(Application.ExeName)+xxxx);
dirpath: String;
filename: String;
filehandle: Integer;
begin
dirpath:= 'xxxx';
filename:= 'test.txt';
if CreateDirectory(dirPath) then
if FileExists(filename) then
CopyFile(filename,dirpath,true)
else exit
else exit;
end;