Read files within folders and subfolders

Hello there everyone!

I need help to iterate through multiple subfolders and search for a given file by name.

I have a root folder (say “C:\TestFolder”) and multiple subfolders within the root folder (say, “C:\TestFolder\Names”, “C:\TestFolder\Dates”, “C:\TestFolder\Adresses”).

I can read the root folder with a for each activity and get the full path for each subfolder, but I can’t seem to get each of those items (complete path and name for each subfolder) and search within each of them for a file.

I have attached an image of the workflow below:

Could you please help me out! Thanks in advance!

@Leonardo_Leipnitz
Maybe following can help:
Directory.GetDirectories(YourPath,"*", SearchOption.AllDirectories)

1 Like

Thank you so much! That does let me iterate through all subfolders.