Does anyone know how this could be achieved.
Lets say our source directory is c:/files/
now inside c:/files/
we have
c:/files/someprogram/folder/anotherfolder/setup.exe
c:/files/someotherprogram/setup.exe
and
c:/files/someVideofolder/Movie.mp4
would it be possible to search the c:/files/
for .exes so that if a directory contains an exe copy the whole directory tree with all its files intact to a new directory c:/CopyFiles/
so its
c:/copyfiles/someprogram/folder/anotherfolder/setup.exe c:/copyfiles/someotherprogram/setup.exe
have been trying this for a while now, with nothing even close to success.
procedure TForm7.Button4Click(Sender: TObject);
var
ExePath : String;
ExeFiles : Array of String;
begin
ExeFiles := TDirectory.GetFiles(Sother,'*.exe',
TSearchOption.soAllDirectories,
function (const Path: string): Boolean
begin
Result := true;
end);
{ExePath := TDirectory.GetCurrentDirectory(exefiles);}
ExePath := TDirectory.GetDirectories(exefiles);
CopyFilesToPath(exepath, Dother);