Issue with the move file activity

Hello All,

I’m facing an issue with move file activity. I gave the folder path as mentioned below.
From- Directory.GetFiles(“C:\Users\ADMIN\Downloads”,“*.xls”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToList(0).ToString

To- "D:\data backup 7.7.23\lenovo desktop\Documents\UiPath\Practice session"+“Newfile.xls”

I want to move file and rename. But I’m getting an error as “Could not find a part of the path”. How to solve this is issue??

Try using a \ character after Downloads
Like this

Directory.GetFiles(“C:\Users\ADMIN\Downloads\”,“*.xls”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToList(0).ToString

Hi @ramshiva_reddy

Try this

Directory.GetFiles(“C:\Users\ADMIN\Downloads\”,“*.xls”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToList(0).ToString

Hi @ramshiva_reddy

First move the file in to a folder by using move file activity.
In the To field in move file activity give the folder path not file path.
After that use the Rename file activity to rename the file.

In the from give the \ symbol after the downloads, download is also a folder we have to give .

Directory.GetFiles(“C:\Users\ADMIN\Downloads\”,“*.xls”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).ToList(0).ToString

Hope it helps!!

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