I want to move a folder to another location.
Eg: I have folder C:/Level1/Level2.
I need to move this Level2 folder to C:/Level1/Target.
‘Target’ Folder already exist with other files/folders.
so once done I should find ‘Level2’ in C:/Level1/Target/Level2
In both the cases its given the destination folder should not exist already but in my case the destination already exist with other files/folders. In that destination I need to move some more folders
Thanks for your reply. This will complicate the process.I need to first create a new directory with the same name and move files one by one also internally it may contain sub folders also. So i feel this will complicate?
As @sarathi125 suggested, Directory.Move method moves a directory and all its contents, including nested subdirectories and their files, to a new location and if the destination directory already exists, an error occurs.
You cannot use assign activity because return type of this method is none.
You can write this code in invoke method activity with the following options:
Target Type as System.IO.Directory
Method Name as Move
Two parameters in property panel with In and String Type for SourceDirectory and DestinationDirectory.
“Invoke Code” – is this the activity I need to use?
When i look at screen shot shot this looks like “Invoke Method” which will throw error since the destination diretiry already exist.
Please check the XAML attached.
In Simple, we can’t move the folder. So I copied the source folder to destination and deleted the source. It works fine. Please check and confirmsample.xaml (5.1 KB)
This will copy a directory and all its subsequent subdirectories and files to your chosen location. Just invoke this somewhere to copy the files and then delete the original folder. Or if you want to, you can replace the ‘Copy file’ activity with a ‘Move’ activity.
While moving the files from one folder to another folder, In this case the main folder files only moved to another folder not sub folder files - Please help me regarding this.
Example : C://Main folder files : Test_001, Test_002
Sub folder : C://Main folder files//Sub folder files : Test_001,Test_002
Hi @Palaniyappan
Many files are in the same names, i need to move main folder files - So i search some file names and move the files from one folder to another folder, While moving the files all files moved, how to split the main folder files.
Thanks
Hey ,I need to move folder with files to destination folder that does not exist but the challenge is i have to move into destination subfolder that does not exists.but when I try passing it in parameters in invoke method I get error saying that cannot find part of the file