I have to copy a folder and then paste it in another location. Can anyone help me with this?
@apriyam use send hotkey activity
start process activity and point out cmd.exe
this example for Delete a directory. you can change the command as per your need
You can try this:
- Store the path of files in array of string.
string FileArr = Directory.GetFiles(filePath); //use assign activity
- For each fileValue in FileArr
Use copy activity with inputs as source - fileValue and target - targetPath.
This will copy all the files from one folder to another.
Does copy file work with folders as well?
I am facing an problem when I point the full path of the folder as source, it gives an Access Denied. While, when giving the full path of a file, on same location, it successfully copies the file.
could you kindly suggest what strategy to use to check if command execution is successful?
based on the command it vary. i usually use while loop after command prompt.something like this.
Check out the workflow posted by ‘Suchi3190’, it works perfectly fine
I’m sure you have already solved the problem but I made a workflow that will help future users out.Copy Directory.xaml (5.4 KB)
You can use Invoke Method activity For It, and in the Target Type give Microsoft.VisualBasic.FileIO.FileSystem and in the properties give the source path and destination path in Parameters.
Thanks & Regards
The xaml example copy folders and files from a folder to another folder.
Is there anyway to just copy folders only from a folder to another folder ?
Don’t copy the files in the folder.
please attach .xaml for same. I am facing problem where to write source/destination path