Hi everyone, Can we copy folder from source to destination using copy file or we just copy files using it?
I tried copying folder its giving me “Access to path is denied”
System.UnauthorizedAccessException
we can only copy files with that
To copy the entire folder, you can use some simple Powershell cmdlets as well for the purpose.
Regards,
Nived N
Hi @rpajyoti_wagh
You can just copy files with ‘copy file’ activity.
But you can use ‘create folder’ and then ‘copy file’ to copy all the files in the old folder to the new one.
Here is a sample from the forum how to use Invoke Method Activity to copy a directory.
Thanks everyone I am clear now
@rpajyoti_wagh - Please check this for your reference…
to workaround the copy activity, i had to use power shell, so there is a activity called “Invoke Power Shell”.
That is the code: “& { $xcopyCommand = 'xcopy “”” + str_pathWindows + “”" “”" + str_pathSharepoint + “”" /E /I /Y’; Invoke-Expression $xcopyCommand }" on powershell UiPath activity. And it worked great.