Point to parent folder of the main.xaml

studio

#1

Hi,

Currently, there are 2 ways that I know to point to a folder or directory, if the current project main file is in “C:\UiPath\Project_1”:

  1. Use project folder as the root folder and point downwards, for instance “Data\Config.xlsx”
  2. Use full folder path, for instance “C:\UiPath\Project_1\Data\Config.xlsx”

Does anyone know if I can point to the parent folder without specifying the full path?
The reason of asking is that I’d like to make several UiPath projects to access the same file without specifying the full path in different machines.

For instance, I’d like to access to folder “…\UiPath…” in the previous example, where it might located under “C” or “D” or any other nested folders.

Thanks a lot!

BR
Helliton


#2

Hi @hellitonwoo,

You can use Environment.CurrentDirectory to get the path in which you are working !


#3

You can refer to the parent folders.

  1. For files that are in Project folder itself, In the above image, if your file is in Input Files folder in Project root folder, you can refer to file as,
    “Input Files/MyFile.xslx”
  2. For files that are located in project’s parent folder, refer the file as,
    “…\MyFile.xlsx”

実行したxamlファイルの絶対パス名:How can I get the "absolute pathname" of the "xaml file" I ran out?
#4

@Madhavi

It works!
Much appreciate the quick help!

BR
Helliton