# Get files in folder inside folder

**URL:** <https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792>\
**Category:** Studio\
**Tags:** tools, question, studio, system, activities\
**Created:** [December 7, 2021, 10:15am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792 "2021-12-07T10:15:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![murat.karasoy](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/murat.karasoy/32/176714_2.png) [@murat.karasoy](https://forum.uipath.com/u/murat.karasoy)\
**Post date:** [December 7, 2021, 10:15am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792/1 "2021-12-07T10:15:54Z")

</div>

Hi,

I have a folder and want to get files. Directory.GetFiles do it but sometimes this folder include another folder(or folders) and I have to get files in this folder(or folders) too. And 2. folder can include 3. folder. ofcourse I have to get files in 3. folder too.

---

<div class="post-metadata">

**Author:** ![Srini84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/srini84/32/464032_2.png) [@Srini84](https://forum.uipath.com/u/Srini84)\
**Post date:** [December 7, 2021, 10:18am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792/2 "2021-12-07T10:18:10Z")

</div>

@murat.karasoy

Check below post for your reference

> [@Get a list of files from a Directory](https://forum.uipath.com/t/get-a-list-of-files-from-a-directory/4783):
>
> I am looking to get a list of documents withing a specific directory Directory.GetFiles(“address”). This is giving me the complete file name but cannot figure how to get this broken down to the individual document names

Hope this will help you

Thanks

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [December 7, 2021, 10:18am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792/3 "2021-12-07T10:18:29Z")

</div>

we can retrieve files from folders and subfolders e.g. by:

```auto
Directory.GetFiles(MyDirPathVar,"*.*",SearchOption.AllDirectories)

```

taken from:

> [@owl bookmark \[CheatSheet\] - Filesystem APIs](https://forum.uipath.com/t/cheatsheet-filesystem-apis/359405):
>
> This CheatSheet introduces the basic use of available functionalities provided by the .Net API in order to deal with the filesystem. With further examples also special cases are presented. Basic Usage System.IO.Directory Directory offers some static methods for basic operations on folder and subfolders arrFullFilePaths | String() = Directory.GetFiles("C:\_demo\FileSystem\SubfolderA") play_button Visuals System.IO.DirectoryInfo The DirectoryInfo class offers instance methods for basic operations on fol…

---

<div class="post-metadata">

**Author:** ![Srini84](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/srini84/32/464032_2.png) [@Srini84](https://forum.uipath.com/u/Srini84)\
**Post date:** [December 7, 2021, 10:19am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792/4 "2021-12-07T10:19:22Z")

</div>

@murat.karasoy

Also check below for your reference

> [@How can I get the names of all folders and subfolders?](https://forum.uipath.com/t/how-can-i-get-the-names-of-all-folders-and-subfolders/210386):
>
> Hello How can I get the names of all folders and subfolders? I tried Directory.GetDirectories(all\_folder\_path) - But finds only one folder Directory.GetDirectories(all\_folder\_path , "" , SearchOption.AllDirectories) and if so does not find anything [image] I am hope for your help Thank’s

Hope this will help you

Thanks

---

<div class="post-metadata">

**Author:** ![Palaniyappan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/palaniyappan/32/524095_2.png) [@Palaniyappan](https://forum.uipath.com/u/Palaniyappan)\
**Post date:** [December 7, 2021, 10:21am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792/5 "2021-12-07T10:21:52Z")

</div>

Hi

Use a simple assign activity like this

 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/4/8/f484e6cd885e152dcc4ad6548244d55f288a22eb.jpeg)

Where arr\_files is a variable of type array of files

Cheers @murat.karasoy

---

<div class="post-metadata">

**Author:** ![murat.karasoy](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/murat.karasoy/32/176714_2.png) [@murat.karasoy](https://forum.uipath.com/u/murat.karasoy)\
**Post date:** [December 7, 2021, 10:41am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792/6 "2021-12-07T10:41:18Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [December 10, 2021, 10:41am UTC](https://forum.uipath.com/t/get-files-in-folder-inside-folder/367792/7 "2021-12-10T10:41:43Z")

</div>

Closed on December 10, 2021, 10:41am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
