Move File | error with max. characters of file name

Hi all,

I have files which I would like to move, but some files have more characters then 260. In this case I get the following error

image

Is there anything I can do about it?

Thank you & BR
Markus

Hi @Markus3003
Try out this syntax
first find the length of thr string
If length >260
Rename the particular file
Then move the particular file

Thanks
Robin

I believe you have only 2 options to go for:

  1. Change folder structure. For e.g. from C:\Long path\Really long path\Really really long path\OutputFile.xlsx to C:\Long Path\OutputFile.xlsx

  2. Map a new drive with most common path e.g. Z drive having path of C:\Long path\Really long path so that file path would be Z:\Really really long path\OutputFile.xlsx

You can save it UiPath project folder and then move it to trg folder**

** you can not use the path beyond the limitation of win

Thank you guys,

but the problem is not the length of the path its the length of the file name (pdf).

Hi

Have a view on this thread
Hope this would help you resolve this issue

Cheers @Markus3003

1 Like

in this case you can opt for 2nd method i.e. mapping new drive with maximum common path possible

@Markus3003 there is a solution for this when it is a path not to worry. I am unsure when it is a file name itself which is long.

We can wait for @otico s answer. I can’t remember the solution clearly, can you share it here?

Hi @Markus3003,

Have you tried the following solutions?

Example on how to use SUBST:

Like for example if the original long path is something like this: C:\Very Long Folder Path\Filename.pdf

SUBST W: C:\Very Long Folder Path

Now to move the file using Move File activity, and then you can set the input path to W:\Filename.pdf

To disable the SUBST command you can run SUBST W: /D

You can find the instruction on how to use the SUBST command from this link: DOS Command: SUBST

-John Michael

1 Like

Hi @otico,

first of all thank you for your answer.

I tried Alternative 1: I did it like described, also rebooted the computer.

image

But I still get the same error in uipath.

With Alternative 2 i do not really know how it works :confused:

I found at least the “invoke powershell activity” but I dont really know what to put there.

image

Thank you anyway.

Best Markus

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