How to copy a folder?

studio

#1

I have to copy a folder and then paste it in another location. Can anyone help me with this?


#2

@apriyam use send hotkey activity


#3

use start process activity and point out cmd.exe

image

this example for Delete a directory. you can change the command as per your need


#4

You can try this:

  1. Store the path of files in array of string.
    string FileArr = Directory.GetFiles(filePath); //use assign activity
  2. 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.


#5

Hi palindrome,

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.


#6

hi ddrdushy1,
could you kindly suggest what strategy to use to check if command execution is successful?

thanks


#7

based on the command it vary. i usually use while loop after command prompt.something like this.

image


#8

Check out the workflow posted by ‘Suchi3190’, it works perfectly fine