Find Files in folder without knowing file name

Hi,

I’m facing a problem in finding files in the Folder means, I don’t know whether in the Folder is their file or not . If there is any file in Folder then Message shows that the File exists or if the file does not present it show the file does not exist.

ThankYou

1 Like

@mnk

Try as below

Directory.GetFiles(“FolderPath”).count

This will list you the count of files

Hope this willhelp you

Thanks

Hi

Hope the below expression would help you resolve this

Use a IF activity like this

Directory.GetFiles(“yourfolderpath”).Count > 0

If it is greater than 0 then it goes to THEN part where use a message box with message as “File exists”

Or it goes to ELSE part where use a message box as “File doesn’t exists”

Cheers @mnk

@Palaniyappan Thanks for solution.

1 Like

Glad
Happy automation @mnk

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