software to get around path length limit in windows

feffrey

Gawd
Joined
Oct 26, 2010
Messages
585
I am having a problem with restoring some files from a backup.
The backup is mounted as a drive in windows, and the source destination is a network share.
When i attempt to copy the folders to a new location so a user can access them and copy what they need, I get the path too long errors with some of the directories. Renaming files and folders is not an option.

I've tried several third party tools to get around the issue including robo copy, rich copy, ultra copier. and some others. Some of them were able to get around the path issue, however they either crashed mid way or had other issues.
I am looking for some app that can copy a folder to another location that won't crash, can handle millions of small files with insane length of path, has logging to let me know if it was unable to copy something, and supporting retrying locked files.

One software I have not tried is Terra copy as I have used several times in the past and have had numerous issues with it every time I used it.

What does everyone else use to get around this issue in windows?
 
It's going to be tricky getting around limits of the filesystem. You're going need to use shorter names and break it up.
 
Ouch - stinks that there is even a limitation.

Is doing this from a bootable linux disk an option? I've recursively copied tons of of trees in linux before and just redirected error messages to a file using 2>/path/to/file/

I think the other way that I've done this is tgz the whole thing up and then just uncompress it where it needs to be.
 
As far as I know, the max path is actually an operating system limit on many windows api functions. So, even if you could copy it, would it be useful if windows explorer or other programs do not work properly?

MAX_PATH is usually 260 characters, that's a long path. You will probably have to restore it to a shorter directory structure, or resort to renaming parts of the path to something shorter (a ,b , c, d, etc.)

I'm not sure how these files existed in the first place? The path was manageable in its original form? Why can't you restore it to be similar to how it was. If people need to be educated to avoid extremely long paths in the future then that's what I would do.
 
As far as I know, the max path is actually an operating system limit on many windows api functions. So, even if you could copy it, would it be useful if windows explorer or other programs do not work properly?

MAX_PATH is usually 260 characters, that's a long path. You will probably have to restore it to a shorter directory structure, or resort to renaming parts of the path to something shorter (a ,b , c, d, etc.)

I'm not sure how these files existed in the first place? The path was manageable in its original form? Why can't you restore it to be similar to how it was. If people need to be educated to avoid extremely long paths in the future then that's what I would do.

It was probably setup that way because the people using it didn't really know what they were doing.

I've had to deal with stuff like this.. where a folder was moved every time a computer was replaced.. but instead of just copying the needed folder, they copied the parent folder as well. Made the directory structure so long that Windows had trouble even opening it... copying it like it was was imposible. Had to spend a couple hours shortening directory names as much as possible before I could even get a lot of the files copied off.

Idiots!!!!!!:mad:
 
Are you restoring to a FAT32 or NTFS volume? On NTFS, the maximum length of a path and file name is about 32K characters. Problems is, most programs think the limit really is MAX_PATH. You might want to write your own tool with correct max-length awareness to get the files copied where you want them to go.
 
I did a little digging, and it turns out the problem isn't the file system (even fat32). But rather explorer.exe being the limited. Microsoft's documentation around this is pretty piss poor, so I quoted wiki. :(
 
It's not only explorer, I've also had problems with simple things like 'copy' under cmd.exe. I had a setup where I was unpacking a lot of archives (containing long directory and file names) and then selectively copied (using a for construct) some files out of the resulting tree to another location, and I was constantly running into problems where files weren't "found" for the copy even though they clearly existed and could be listed.

It's a joke.
 
I did a little digging, and it turns out the problem isn't the file system (even fat32). But rather explorer.exe being the limited. Microsoft's documentation around this is pretty piss poor, so I quoted wiki. :(

There is some documentation on it and how to get around it.

http://msdn.microsoft.com/en-us/library/aa365247%28v=VS.85%29.aspx#maxpath

The problem is, what you are going to use these files for? It could be a big problem to all sorts of unknown programs trying to actually use these files. You basically can't rely on them working with paths over 260 characters.
 
You said you had used third party app, have you tried to use Long Path Tool? If you haven't try this out. Maybe this will help you in transferring or copying folders to a new location.
 
Many applications (and Windows Explorer?) should allow you to work around the Max Path limit by using the following syntax.

\\?\Letter:\path

It is trial and Error per application as it requires the developer of the application to use the appropriate File/Directory APIs that support this and not certain "legacy API" that were never updated to support it.
 
Back
Top