Get Current Directory

Hello,

Anyone who can help me to get the path file look like on the screenshot 1?
Because i want to open and start from the Sequence Major which is the file is inside the GetDataMandiri folder look like on the screenshot 2.

screenshot 1 :


screenshot 2 :

Regards,
Brian

@Brian_Henokh1

Could you please tell more details for better understanding.

Do you want to open that mentioned file ?

If yes then use Start Process activity and specify that file path into it.

1 Like

I want to start running the workflow on the SequenceMajor file that is inside the GetDataMandiri folder. I asked how to get the position (directory) of the folder so that the existence of the file can always be known (if the GetDataMandiri folder is moved anywhere, the folder can always be easily accessed)

@Brian_Henokh1

To find all directories under E drive.

   arrDirectoties [] = Directory.GetDirectories("E:\")

And then use ForEach loop to iterate that array and find required directory is there or not.

2 Likes

Nice, that’s work. Then how should i to get one of file in that array directories?

1 Like

Hi @Brian_Henokh1

Try to loop with for each item and print the file

Thanks
Ashwin.S

1 Like

@Brian_Henokh1

Again you have to use one more loop to get files inside that directory.

 getFiles [] = Directory.GetFiles("FolderPath")

Where replace folder path with required folder name from above array.

1 Like

Hi we can mention as
arr_files = Directory.GetFiles(“E:/GetDataMandiri/Data”,”.”)

This will give all the files from the folder
Or if we know the file extension then we can specify them in second argument like this
arr_files = Directory.GetFiles(“E:/GetDataMandiri/Data”,”*.xaml”)
Which will give us all xaml files in that folder

Cheers @Brian_Henokh1

1 Like

@Brian_Henokh1
item = Directory.GetDirectories(“Your Path”)
path = Directory.GetFiles(item.ToString,“*”,SearchOption.AllDirectories)
image
It will give path of all the files inside a directory. Even if it’s inside a sub directory.

1 Like

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