Take a file, rename it and copy it to a new location

I am trying to get path of file txt, rename it in the date time format and copy the file to the new location. In my code
vplace = system.io.directory.getfiles(“path”) using this I am getting the path

Vplace is declared as string

When i am trying to copy, I am putting the from path as vplace.ToString

It is not working, I am getting the error "Source copy file
Message : Could not find file System String

1 Like

Use Copy File Activity

1 Like

Thanks for the reply

my file will be a downloaded one and name of the file will random so I want to extract the file name from the path and procced. In your I could see that the file name is already defined

Thanks for the reply

Can you pls provide the steps

Okay DO the following steps

  1. Files = Directory.GetFiles(<Required_Folder_Path>)
  2. Fore each FILE in Files
  3. Use Copy File activity Path= FILE & Destination= New_Folder_Path + Path.GetFileName(FILE)

It’s done!


Thanks, now it is working


thats cool.

How do we find our exact file and then copy this exact file to another location?
do we need if activity for it? how do we use it?