Hello, how to check if there are any files in a folder UiPath? I have in if activity, condition: Directory.GetFiles(C:\Users\login\Desktop\Folder\Folder\Folder, β.β, SearchOption.AllDirectories).Count > 0, but I have error:
Any ideas what could be the problem?
Thank You
Hi,
Can you try the following?
Directory.GetFiles("C:\Users\login\Desktop\Folder\Folder\Folder", "*", SearchOption.AllDirectories).Count > 0
Regards,
2 Likes
Thank You @Yoichi It works! Do you know how to make it check files in two folders at the same time?
Basically, we need to check the folder one by one. However we can write it using a single expression as the following, for example.
arrFolder = {βc:\tempβ,βc:\testβ}
Then, condition will be as the following.
arrFolder.Sum(Function(f) Directory.GetFiles(f,"*").Count)>0
Regards,
2 Likes
Thank You! Have a nice day
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.