I am trying to use the invoke code activity to type in the following code: Directory.Move(sourceDirectory, destinationDirectory); But it showing the following error that character is not valid.
Also not sure if I am using this activity correctly. But basically I want to pass in the arguements of sourceDirectory and destinationDirectory to the activity.
First you need to create the arguments in invoke code activity and then use it inside the code as variables
Just check this and post the error screenshot for better understanding if you still got the same error
invokeCodeDirectoryMove.xaml (4.6 KB)
Please go to edit arguments, give source path and destination path.
Here is the documentation and example from UIPath docs.
Please refer how to use Arguments in Invoke Code Activity.
@kadiravan_kalidoss I tried running the code with the source and destination. But it is giving me the following error.
Check the file paths are valid one… For me its running fine.
Yeah I have checked them. Can I ask this should able me to move a folder from source to the other folder in the destination. As it works when you want to move the folder to a new folder that doesnt already exist.
Yeah, first check with getfiles and if it is working fine, then do as required.
Why dont you use move file activity
We can use Move file activity, ensure the paths are available using path exists activity. If path not found, using Create Directory activity create the folder then Move the file.
Yeah that sounds like the plan. Thanks man.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.