Avatar of hypercube
hypercube
Flag for United States of America asked on

Backing up files with filename\path length >256 characters in Windows 10 Home 64.

I have 400GB of files to back up for safety purposes onto an external USB HD.
I started using just the copy and paste for the whole thing and, it appears, this worked OK - probably better than one should expect.
However, there were many filename/path combinations that were too long.

The files aren't "mine" and I don't have any way to judge how to change the path length.
Yet, I'd like to get the backup job completed so I can move on to the next task.

I've tried running xcopy
C:\WINDOWS\system32>xcopy "C:\office" F:\office /c /d /e /h /i /k /q /r /s /x /y
but this results in
Unable to create directory - [name]
File creation error - The system cannot find the file specified.

This is on a Windows 10 Home 64-bit workstation.

Now, I've checked and the files appear to be there even if the filename/path length is greater than 256 characters.
There are too many to manually deal with this and I'd like to back up the remaining files that were initially missed.

Once the backup is done, perhaps we will be able to shorten the path lengths.  But the backup really needs to be done first if at all possible.

I'm doing this remotely so my ability to do things with the hardware or to boot from DVDs, etc. is accordingly limited.
What would you do?
Windows 10Storage SoftwareWindows OSHardware

Avatar of undefined
Last Comment
hypercube

8/22/2022 - Mon
kenfcamp

Have you tried Robocopy?
☠ MASQ ☠

What would you do?

I'd use Robocopy instead of Xcopy
John

In addition to the above, try bulk renaming intermediate folders to a shorter length. At this point in time, there is not a Microsoft solution for long filenames so it is best to shorten them somehow.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
hypercube

ASKER
John:  
The files aren't "mine" and I don't have any way to judge how to change the path length.
We are working with the owners to suitably fix the length issue.

I would try Robocopy but had installed Beyond Compare to investigate the difference.  Not only did it find and display them nicely, it was able to copy them across at any level, file or directory.  But, in the future, I'll keep Robocopy in mind.  But nobody really said: "Robocopy will take care of this problem".  So, just to be sure: Will it?
John

On a one time basis, Robocopy will get files from here to there as suggested above but the the problem persists. My suggestion above was for a longer term solution
ASKER CERTIFIED SOLUTION
kenfcamp

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
☠ MASQ ☠

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
hypercube

ASKER
Robocopy supports 256 characters by default
If so, why was it recommended?
But, nonetheless, I do appreciate the suggestions!

Now, I have seen the regedit for LongPathsEnabled;  however, it seems that not all things respond to this setting change.  So, I'm left with wondering and asking: "Will it help in this case / with this app?"
For example, I believe it will not work with Windows Explorer.  What else?  etc.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
☠ MASQ ☠

Robocopy supports LongPaths by default - not the other way around - you can limit it to 256 characters in its settings configuration if you choose to but there's normally no need.

You're right that not all Windows software supports longpaths, however since the Win 10 Anniversary Edition 64bit Windows' Kernel does and by extension 64bit Windows File Explorer. Most newer 64bit Windows Apps are longpath aware but 32bit versions are much more hit & miss.

For your backup purposes though that shouldn't be an issue.
SOLUTION
kenfcamp

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
hypercube

ASKER
Well, let's be clear:  I see from that link that Robocopy has an option:
/256  Turns off support for very long paths (longer than 256 characters).
Now, that does NOT say:
/nnn Turns off support for very long paths (longer than nnn characters).
No.  It's very specific.  
It clearly implies that longer than 256 characters support is the default.
And that's what everyone said....  
Thanks! Sorry it took me a bit to believe what I was reading.....
hypercube

ASKER
Thanks again!!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23