Copy same folders and rename it multiple times with different names

I need to copy the same folder as many times as there are the entries in column A of excel sheet and rename it with the data present in column B of Excel sheet.

Employees.xlsx (12.3 KB)


Use for each row in datatable activity

and inside it use Copy folder activity

So for each row the name is repeated will be copied again


I have used the same but folder is copied just once.


Can you show what you did

Inside the loop did you use currentorw(“ColumnBName”).ToString for destination folder anme


"C:\Users\kunal.jain\OneDrive -ABC\Documents\UiPath\Planner_Core_Tasks_\TestFolders"+CurrentRow(0).ToString

Hey, @Kunal_Jain
You an refer this
Main.xaml (9.5 KB)


Hi @Kunal_Jain

  1. Use a Copy Folder activity to copy the source folder to the destination folder. You can choose to include subfolders or replace existing folders if needed.

  2. Use a For Each activity to loop through the files in the destination folder. You can use a variable like file to store each file path.

  3. Inside the loop, use a Move File activity to rename each file. You can use an expression like

Path.Combine (Path.GetDirectoryName (file), "NewName" + Path.GetExtension (file)) to generate a new file name with the same extension.

Repeat steps 2 and 3 for each folder that you want to rename.




I have gone through the xaml and I guess you have folders with 1 to 10 and you are copying the same to the employee name…that is 1 as first employeename , 2 and second employeename etc

Are you not getting the output like that?

and can you try like this to be double sure





Sorry Please Try this.

Hi @Kunal_Jain, Please try the following.

In ‘Copy Folder’ activity, ‘From’ should be the path of the folder you want to copy, ‘To’ should be the path of the folder you want the folder to be copied to.
Note: It will copy the desired folder with same name to destination folder.
E.g. From: “D:\Personal\Learning\UiPath\RoboticEnterpriseFramework-WindowsCompatibility\Data\Input\SampleFolder”
To: “D:\Personal\Learning\UiPath\RoboticEnterpriseFramework-WindowsCompatibility\Data\Output”

Then use ‘Rename Folder’ activity to rename the copied folder to desired name.
‘Folder’ should the path of the folder just copied and ‘New Name’ should be value coming from DataTable.
E.g. Folder: “D:\Personal\Learning\UiPath\RoboticEnterpriseFramework-WindowsCompatibility\Data\Output\SampleFolder”
New name: CurrentRow.Item(“Name”).ToString

Edit: Added screenshots


Actually I just need one column that is “Name” to rename the folder.
And I just need to copy 1 folder as many times as there are names present in "Name"column of excel sheet


Then use a static input folder do not use empid in teh source…Instead use a static folder path as source


and in destination use along with the name column that is



Can you help me with the workflow please. But it also contains sub folders whose name should not be changed

Hi @Kunal_Jain, Please find the workflow attached. But I’m not sure if you’ll be able to open due to version difference, give it a try.

No, they won’t be renamed.

CopyFolders.xaml (9.9 KB)

Rename Folder: Invalid value for parameter “New name”.
I am getting this error
Also I am not able to open the xaml that you have provided

You need to pass a string value. Can you please check and share the screenshot of the error and also what you’re passing there, if error still exist?

Please follow the steps mentioned with screenshots here Copy same folders and rename it multiple times with different names - #11 by Vamsi_Krishna_Gogineni

Paths mentioned here are just for your reference, please use yours relatively.