# Directory path

**URL:** <https://forum.uipath.com/t/directory-path/407917>\
**Category:** Activities\
**Tags:** system, activities\
**Created:** [March 18, 2022, 12:28am UTC](https://forum.uipath.com/t/directory-path/407917 "2022-03-18T00:28:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cury](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/cury/32/264919_2.png) [@cury](https://forum.uipath.com/u/cury)\
**Post date:** [March 18, 2022, 12:28am UTC](https://forum.uipath.com/t/directory-path/407917/1 "2022-03-18T00:28:05Z")

</div>

Hi,  
Is it okay to use relative paths for directories or files for example, directory.getFiles() or FileExists(). Or is it needed to give Absolute Path. If I have a sub folder Data, can I use directory.getFiles(“Data”) ?  
Thanks a lot,

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [March 18, 2022, 12:50am UTC](https://forum.uipath.com/t/directory-path/407917/2 "2022-03-18T00:50:31Z")

</div>

Hi,

In most cases, we can use relative path. However, in some cases, it might be better to use absolute path to prevent trouble in advance. (Because current directory is not same b/w run from studio and run from process (UiPath assistant or Orchestrator, for example)

```
path = System.IO.Path.Combine(System.Environment.CurrentDirectory,"Data")
System.IO.Directory.GetFiles(path)

```

Regards,

---

<div class="post-metadata">

**Author:** ![cury](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/cury/32/264919_2.png) [@cury](https://forum.uipath.com/u/cury)\
**Post date:** [March 18, 2022, 1:30am UTC](https://forum.uipath.com/t/directory-path/407917/3 "2022-03-18T01:30:17Z")

</div>

Thank you @Yoichi

---

<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:** [March 21, 2022, 1:31am UTC](https://forum.uipath.com/t/directory-path/407917/4 "2022-03-21T01:31:09Z")

</div>

Closed on March 21, 2022, 1:31am UTC

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