Moving a file without giving the filename(it changes again and again) in the path

I want to move an excel file from one folder to another using the move activity so how can I perform this activity as providing the full path including the full name(file name), it is working fine. But the problem is the excel file name keeps on changing. (excel file: abc_01-07-2019, abc_02-07-2019).So, any help would be appreciated


strExcel [ ] = Directory.GetFiles(“FolderPath”,“*.xlsx”)

It will read all Excel files from folder and will give output as String of array. And then use For Each loop to itreate that array and inside use Move File Activity to move it.

But there is only one file in the folder so is it necessary to use arrays

Hi @Ejaz44

Use this assign activity by @lakshman and once you got all the files, you can use the component that I created and published in UiPath Go! that moves files:

You will just pass the strExcel and the folder path where you want it to be moved.

Thank you :slight_smile:

1 Like


Ok. Then use Move File Activity after that above expression.

And pass source as strExcel(0) and specify destination folder.

1 Like

can we use wildcards in the variables in which the path is stored

My problem is that the program is working properly, it is showing me error when the filename is changing so is there a way that I can change or add a wildcard(*) in the variable which is storing the path and I think after that it will be working fine.