How to copy files that have too long of a filepath in Windows?
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Unforgiving Himalayas Looping
--
Chapters
00:00 How To Copy Files That Have Too Long Of A Filepath In Windows?
00:21 Accepted Answer Score 31
00:59 Answer 2 Score 84
02:22 Answer 3 Score 21
03:55 Answer 4 Score 5
04:15 Thank you
--
Full question
https://superuser.com/questions/216704/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#windows7 #windows #copypaste
#avk47
ANSWER 1
Score 84
robocopy /E source destination
Windows 7 and above, (including Windows 10):
Robocopy XP027 is a standard command on Windows 7 and above.
Windows versions > 7 may have other Robocopy versions,
as Robocopy is still maintained.
Please read the link above for more details regarding,
limitations in specific versions of Robocopy.
NT 4/ Windows 2000:
The Windows Server 2003 Resource Kit Tools include Robocopy XP010,
which can be run on NT 4/ Windows 2000.
Windows 95, or NT 3.5:
Robocopy does not run on Windows 95, or NT 3.5. (Robocopy is a Unicode application).
Windows 95, or NT 3.5 workaround:
The Microsoft Robocopy GUI will install Robocopy XP026 to C:\Windows\system32,
this version can run on older OS's,
and includes some features from XP027 (/BYTES) but has competely broken errorlevel handling.
Robocopy 'Jobs' and the 'Monitor source' option provide an alternative to setting up a Scheduled Task to run a batchfile with a Robocopy command.
ACCEPTED ANSWER
Score 31
Maximum path length is 260 in Windows Vista/7. I can recommend three solutions:
- (if the path is too long) First copy the folder to upper levels in Windows Explorer and then move it to your local computer
- (if file names are too long) First try to zip/rar/7z them with an archive application and then copy the archive file to your local computer and then extract the contents.
- Use third-party apps.
All of these suggestions assume you have some sort of write access on the network shared folder/computer. If you can't do any of these then you might need help from your administrator.
ANSWER 3
Score 21
You can access path lengths up to ~32,767¹ characters by prefixing them with \\?\
.
\\?\C:\Some\Really\Long\Path
This works from the command prompt and any other programs which use the Win32 Unicode Api methods, including C# applications and anything else written in the .Net framework.
It does require a file system that supports long paths (eg NTFS) but if you have a long path problem, that's a given.
Note that certain applications and a lot of native tools (like Explorer) will have problems with these paths so use this to get yourself out of a hole, not into one.
You can also use a variant \\?\UNC\
to access long paths across network shares...
\\?\UNC\server_name\share_name\...
¹ For those that are interested, it is 32,767 not 32,768 as it's a null-terminated string, but the \\?\
may be expanded, consuming some characters, so don't rely on the count being precise.
ANSWER 4
Score 5
FastCopy is open source C project written by SHIROUZU Hiroaki and is "The Fastest Copy/Delete Software on Windows." It supports UNICODE and over MAX_PATH (260 characters) file path names.
If you have hundreds of paths that are too long to fix, use "Path Tool Long Auto Fixer" Tool