Cannot copy files - source filename are larger than is supported error

Not able to copy files from one drive to another drive showing error : source filenames are larger than is supported.
I need to copy over 700GB to another location.

Any recommendations or solutions please...
vibinsathyanAsked:
Who is Participating?
 
oBdACommented:
Use the command line tool robocopy.exe (part of the OS since Vista/Server 2008), it supports long file names.
The syntax is slightly different than copy or xcopy, it expects the source folder first, then the target folder, then the file mask (*.* if omitted), then other options.
Note that robocopy will by default skip files that already exist in the target folder in the same version (size and date), so it won't copy unnecessarily if you run the copy more .
Enter "robocopy /?" in a command prompt for details, it has lots of useful options.
You can start with something like this:
%Systemroot%\system32\robocopy.exe "C:\Source\Folder" "D:\Target\Folder" *.* /e /r:0 /w:0 /np /tee /log:"C:\Temp\robocopy.log"

Open in new window

/e will copy subfolders, /r:0 and /w:0 set the the retry and copy counts (usually only needed over unreliable networks), /np will disable the progress bar for larger files (because it uses control characters that make the log file hard to read), /tee sends the output to the console and a log file, and /log sets the log file.
If you wan to copy including NTFS permissions, add /copyall to the options.
1
 
helpfinderIT ConsultantCommented:
I think it´s not about how many GB the files have but that filenames are too long. Maybe just filename or whole path (if you have a lot of subfolders)
try to reduce number of subfolders or lenght of characters in the file name
0
 
vibinsathyanAuthor Commented:
Seems like that ..but it is impossible to  change file names as this is a backup folder(incremental) and have thousands of folders and subfolders. any other way I can copy??? because my drive is full and need to copy that to any external HDD inorder to free the space for daily backups.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
helpfinderIT ConsultantCommented:
if you have your files and folders like
D:\folder/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/r/s/t/file.txt
D:\folder/a/b/c/d/e/f/g/h/i/j/k/aa/bb/cc/file.bmp
D:\folder/a/b/c/d/e/f/g/h/i/j/k/11/22/33/file.dosx
and it is too long, try to map new network drive e.g. X: and map D:\folder/a/b/c/d/e/f/g/h/i/j/k path.
then try to copy files and folders from X: to your external drive - maybe it will work like this.
If not then probably you have to copy files and folders from D:\folder/a/b/c/d/e/f/g/h/i/j/k to D:\TempBackup and then from D:\TempBackup to your external drive
0
 
Gary CaseRetiredCommented:
You can confirm that the path length is the issue with this nifty (and free) little tool:
http://www.softpedia.com/get/System/File-Management/Path-Scan.shtml

Assuming that's the problem, there are several ways to resolve it.   A couple simple approaches are:

=>  Create a .Zip file containing the files you want to copy (use a name for the .Zip file that doesn't exceed the path length restrictions) ... and then just copy the .Zip file.    I use 7-Zip for these kind of operations.

=>  Use the LongPath fixer tool from Corz:  http://corz.org/windows/software/accessories/Long-Path-Fixer-for-Windows.php

=>  Use the "subst" command to substitute a very short path (e.g. a drive letter) for the long part of the path ... this can make the total path much short (well within the path length restrictions).    See examples here:  http://vimalsuresh.com/2013/08/08/how-to-fix-file-path-too-long-error-while-copying-deleting-or-opening-files-without-using-third-party-applications/
0
 
vibinsathyanAuthor Commented:
Thanks everyone for the replies..Let me try oBdA suggestion..other suggestions seems not practical in my scenario..I was trying to copy installing teracopy and it is indeed working till now(only 20% finished)..let me confirm the outcome..
0
 
vibinsathyanAuthor Commented:
oBdA suggestion (Robocopy) worked..but it is taking a lot of time (only 25% finished of 700GB and 20Hrs finished) ..thank you for the replies.. :)
0
 
marguy1Commented:
To expand on oBdA's great answer, you can use a GUI utility that performs the same command line function, it's called 'RoboMirror', it's great and it's free.
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.