Copy folder with a path longer than 260 characters

Hi, I need to copy a folder to another folder and then work on files in it. The problem is that some files have really long names, and thus the path is longer than 260 characters. This makes the method FileIO.FileSystem.CopyDirectory crash. Is there any way around this issue?

I know that there is also System.IO.Directory.Move, but it will delete the folder from origin, which must not happen. Some mention a workaround with the path prefix "\?", but UiPath does not seem to recognize it and gives an error “Illegal characters in path”.

Hi @jreddy ,

Could you give this solution a try and see if it works out for you?

Kind Regards,
Ashwin A.K

1 Like

Hey thanks @ashwin.ashok ! It worked fine. I struggled a bit to wrap my head around all the quotes in the cmd command, but I made it work in the end :slight_smile:

Here is what my Arguments line for Start Process look like:
“/C robocopy “””+PathFrom+“”" “”“+PathTo+”“”"

image

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.