I faced this error message:
“The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.”
I am using the following code to get the array list of file names
Directory.GetFiles(“directory path”,“*”,searchOption.AllDirectories)
There are manly levels for the folder structure thus the path is long. Is there any way to increase the character limits or ways for me to get the path? Thanks.
Hi @Pradeep_Shiv, thanks for the reply. I managed to get the file and folder names but as there are many level of subfolders, the path become really long so I’m face with the error msg. Is there any way I can increase the characters limit?
I need to store the full path so wondering if there are any ways so I can store the path?
I have the error msg when it is running the for each where my input: Directory.GetFiles(“directory path”,“*”,searchOption.AllDirectories)
I guess some of the file path is too long: I can’t put the full path here but it exceed 260 characters. I have also tried to map the path as a network drive to shorten the path but it doesn’t work as well.
I couldnt see which path the bot stuck at that shows the error msg, is there any way I can see it?
Hi @emily - you can add the logic between try/catch and log the file path along with exception details exception section. so that it will be easy for us to track the issue.