How to copy a file from one folder to another folder

Hi ,

How to copy a file from one location to another location with the file name ?

folder one : c:\user\abc.xlsx
folder two : d:\users

expected o\p : d:\users\abc.xlsx

P.S : I don’t want to move the file

Hi @priya_joshi_thaneti

Use this activity

https://activities.uipath.com/docs/copy-file

image

image

In properties you can give From and To which is source and destination paths

Thanks,
Prankur

3 Likes

I have used this activity ,

I’m getting an error saying that "Couldn’t find the path ‘d:\users\abc.xlsx’ "

where as the file path is already existing

Hi,
Use the Copy file activity.

1st parameter is to provide the path where you want to copy the file.
2nd parameter is where you want to copy the file with a file name.

Thanks
Vivek S.

1 Like

but here the file name is not constant .

I want the same file name in the destination as well .

And also the source path gets the files while executing the loop.

okay you mean there is a folder users exist in D drive?

1 Like

yes …

Can you try this activity in same drive with different folder names. No problem in paths and names they can be dynamic

1 Like

Ok… but here the requirement is two different folders (I.e I will be using the shard path as destination from local folder(source folder))

Looks like some path issue bcz it is working good with same and different drive too.
Are you able to perform the same operation manually?

Might be you are coping file where folder doesn’t exist.

Please check once.

@PrankurJoshi is the right about Path and file name can be managed.

It is achievable. Just check do you have permission to put a file over there?

Copy file to the shared path is working for me.

Thanks
Vivek S.

Create a test folder on root in C drive and try this might be happening because you are using users folder of C drive

1 Like

Hi,

I think file is already exists in the destination folder. Click on overwrite option in properties panel and try.

If you still face the issue attach your error message or code.

Thanks

How to copy a file from one location to another location with the file name ?

folder one : c:\user\abc.xlsx
folder two : d:\users

expected o\p : d:\users\abc.xlsx

P.S : I don’t want to move the file

Hi,

Use the slash ""

Use folder two : d:\users\

Thanks

Hi
Pls refer the below …where I have discussed about copyfile activity

1 Like

@karthik_bethi Thanks man !!!

Hi ,

am trying to copy all files in a folder located in share drive to local c drive . am unable to do this, please help.

1)Create same folder in C drive
2)copy all files from share drive to C drive

Thanks,
Nandhini

Hi @sravan_kumar1,

folder one: as you entered (c:\user\abc.xlsx).
folder two: as you entered as expected o\p (d:\users\abc.xlsx) and not as d:\users.

Good afternoon

I tried the options you mentioned, but the error still persists.
Any other solution?