Moving Sub folders to Existing folder

Hi Experts,

How to Move sub folders to existing folder without creating new folder . below is the example

New York(Sub Folder)
Chicago(Sub Folder)
Boston(Sub Folder)

Above sub folders should move to USA_City Folder . USA_City folder is already exist , no need to create newly .

     Thanks in advance 


1 Like

Hi @ramesh988,

Folder path->Y,
str= directory.getfiles(Y)
for each item in str
Before move check the current folder is root folder or sub folder using if condition.
Use ‘Move File’ activity
Or you can use invoke method to mive a folder
Directory.Move(sourceDir, destinationDir)
Using create Directory you can create a folder in the path.


Hi Arivu,

I have already used invoke method in that new folder is being created and the source folder is deleting . i want to move the sub folders without creating new folder.
Can you please tell me how to use directory.Move(sourceDir, destinationDir). Please give me sample xaml.

Do you want to move above folder to a already created folder USA_City
or you want to move content of these sub folders to USA_City.

Hi Priyanka,

USA_City folder is already created , we should move sub folders to USA_City folder.