20

I have an external hard drive with many files (800 GB). I want to copy the entire contents of the external hard drive to my local drive. get many errors about long file name or long file path. Renaming is also not possible because of number of errors.

What can I do about this issue?

Oliver Salzburg
  • 86,445
  • 63
  • 260
  • 306
SliverLight
  • 203
  • 1
  • 3
  • 5

1 Answers1

17

You'll get these kinds of errors if you use the drag-and-drop copy within Windows explorer.

However, if you use Robocopy, you should find that you can copy the files without any issues.

The command-line version of Robocopy is built-in to Windows 7 and Windows Server 2008; it can be downloaded for other operating systems. Although there is a downloadable GUI, it's best used from the command line (aka CMD.exe).

By default, Robocopy should handle paths greater than 256 characters (there's a switch to turn it off, but in your case you don't want to do this).

Example command line (which will copy all files in the folder C:\Projects to the folder Z:\Projects):

robocopy "C:\Projects" "Z:\Projects" *.* /COPY:DAT /E

misterjaytee
  • 1,883
  • 1
  • 14
  • 21
  • thanks for answer / would you plz tell me which parts of robocopy should i check for this purpose! – SliverLight Oct 23 '11 at 10:34
  • those checks are so important... – SliverLight Oct 23 '11 at 10:37
  • 1
    Edited answer to provide an example Robocopy command – misterjaytee Oct 23 '11 at 12:02
  • thanks for edit / should i use this command in command prompt(cmd) or robocopy has a place for using that command? – SliverLight Oct 24 '11 at 10:28
  • As it says in the text, "use it from the command line" otherwise known as the command prompt or CMD. – misterjaytee Oct 24 '11 at 18:44
  • thanks for comments / but in visual mode where places should i check for the best entire copy ? – SliverLight Oct 26 '11 at 10:36
  • you can downlaod it from this link -> http://technet.microsoft.com/en-us/magazine/2006.11.utilityspotlight.aspx – SliverLight Oct 26 '11 at 10:38
  • robocopy gui only copies some files and folders just 4 a second / not all files and folders / but that cmd command works perfect. – SliverLight Oct 26 '11 at 11:15
  • Glad you got it sorted - to be honest, never used the GUI and hadn't realised that's what you were trying to use. Command line wins every time for me ;) – misterjaytee Oct 26 '11 at 18:37
  • /COPY:DAT is the default. From the documentation... /COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT). (copyflags : D=Data, A=Attributes, T=Timestamps). (S=Security=NTFS ACLs, O=Owner info, U=aUditing info). – buzz3791 Jan 09 '14 at 14:22
  • @buzz3791 - yes I know. But defaults change from time to time and it does no harm to put in the intended copyflags. – misterjaytee Jan 10 '14 at 07:45
  • Can Robocopy solve the problem at http://superuser.com/a/216718/78897 ? – Pacerier May 16 '15 at 00:33
  • @Pacerier - absolutely, I use robocopy for this purpose frequently – misterjaytee Jun 29 '15 at 21:31
  • @misterjaytee, While robocopy is built-in, I've heard Terracopy is much better. Why don't you use that? – Pacerier Jul 02 '15 at 09:35
  • @Pacerier - I was answering a question based on lots of experience of using Robocopy. Main reasons for not using Teracopy are: Robocopy is built into all currently supported versions of Windows and works nicely enough for our requirements; and Teracopy is commercial software (i.e. you pay for it) - it is only free for personal use. – misterjaytee Jul 25 '15 at 10:19