Forum Discussion

NisHera's avatar
Valued Contributor
10 years ago

Copy file in unknown sub directory

How can i copy file in known directory un- known sub directory eg my application generate xml file. It is placed in spool directory and sub derectory with random name  like C:\Spool\78283...
  • HKosova's avatar
    10 years ago
    You can use aqFileSystem.FindFiles to find the file by its partial path, and then copy the found file.


    var foundFiles = aqFileSystem.FindFiles("C:\\Spool", "*.xml", true /* search subfolders */);

    if (foundFiles != null)


      foundFiles(0).Copy("C:\\myfolder\\New.XML", true);




      Log.Error("File not found");