Copy one file in every folder

Hey this was for my previous project(robot) for this one i need to copy one file (excel) and paste it in each sub folder.

Okay got it - try the following xaml

Main.xaml (6.0 KB)

Try this solution again with the xaml that I provided that should solve your query :slight_smile:

Again same error :

image

It’s really strange of course is directory i want to copy the file in each directory why this error come up.

Hi @Shwapx

You need to do the following thing :-

Below is the Workflow for the same :-
Practise Solutions for Forum.zip (73.1 KB)

In the Above workflow i am copying all files in the Dummy folders to the MainFolder having subfolders named as Child1, Child2, Child3, etc

And the error you are getting above is bcz of not adding the fileName in the Destination of Copy File Activity as i have added in my workflow as shown below :-

subfolder+“\”+Path.GetFileName(file)

Mark as solution and like it :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

3 Likes

Thanks for this i’m going to test it out tomorrow just one question this getcurrentdirectory is used to take the directory of the project folder right ? and if i don’t want this to be there i can remove it and just include full path of folder ?

Hi @Shwapx

Yes, You are right.

Directory.getcurrentdirectory

I have used to get the directory of the project folder.

And If you dont want that to be der then you can remove it and can include full path of folder that you want.

Mark as solution and like it if that helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Can this work with one file only and don’t take all files in any directory just one file to copy in all subfolders.

Hi @Shwapx

Yes. Remove the inner forEach Activity. And pass the Single File Path in Copy File Activity in the source value.

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

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