I’m working on a solution that lists folders and files of a given folder. Sometimes a given folder has such a complex and deep structure that a PathTooLongException occurs (maximum 260 characters or 248 for directories). Unfortunately I may not rename files or folders to reduce path length. In fact, I don’t have any influence on given folders. I just have to deal with the long paths.
- researching the problem in UiPath Forum, but most answers are bots praising long path tool - doesn’t fit my requirement
- an alternate way to get paths with PowerShell script instead of VB .Net - same error!
- Using the
\\?\prefix to use Windows API without path length limit (i think?), but now characters in the path (e.g. dots (.)) are invalid
- Setting RegistryKey for LongPathEnabled as described here, but I didn’t get the application manifest part and it didn’t work on its own - do I have to edit Studio.manifest?!
I also stumbled upon the ExtendedFileInfo library that looks like it could help, but sadly I am clueless how to implement this into my UiPath flow.
Any help is greatly appreciated!