Change filenames and copy files under for each file in folder

Hi everyone!

I am now using the modern activity to extract the filenames within a folder. I want to change filenames and copy files to a subfolder under the source folder as well. But using the steps below, the system tells me that they cannot find the specific files to copy in the folder. Is there anything wrong with my step?

FilesName = Path.GetFileName(CurrentFile.Tostring)
RenameFiles = FilesName.Substring(0, FilesName.Length - 4) + “" + DateTime.Now.ToString(“yyyyMMdd”) + "” + DateTime.Now.ToString(“HHmmss”) + ".csv”

Both variables are set as strings. Many thanks if you can help.

Can you check:

Using CurrentFile instead of FilesName

Hi @ppr

It will show the following error.

then try CurrentFile.FullName

1 Like

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