1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Transferring files from Computer to Portable Hard Drive

Discussion in 'All Other Software' started by prephil, Nov 3, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. prephil

    prephil Thread Starter

    Joined:
    Feb 9, 2007
    Messages:
    53
    Hi all,

    I'm transferring files from our server to an external hard drive for backing-up purposes (transferring a few hundered folders at once totalling around 5GB).

    During the middle of a transfer it stalls and cancels and says there are too many characters in a certain file/files. How can I prevent this from happening. I don't want to manually remove files with long names (if I have to, is there a way of doing a search for files that contain a certain number of characters in their names).

    Any suggestions appreciated.

    God bless,

    Phil.
     
  2. -Fabez-

    -Fabez-

    Joined:
    Jul 28, 2008
    Messages:
    1,899
    You could code something to shorten the file names, then restore them when they are on the portable hard drive.
     
  3. prephil

    prephil Thread Starter

    Joined:
    Feb 9, 2007
    Messages:
    53
    How exactly can I do this?
     
  4. -Fabez-

    -Fabez-

    Joined:
    Jul 28, 2008
    Messages:
    1,899
    You will need to enumerate all of the files and folders, checking the length of their names. If the length exceeds a certain amount shorten it and store the old and new name in an array for restoration purposes.
     
  5. Mr. Newton

    Mr. Newton

    Joined:
    Aug 26, 2006
    Messages:
    15,274
    First Name:
    Terry
  6. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    How are you copying the files? Both Windows Explorer and xcopy have a path length limitation of 260 characters, it's one of the limits of Windows.
    So if you are copying C:\Stuff to X:\Servername\date-backup\Stuff\ you can end up with a path that is too long. You can map a drive letter to X:\Servername\date-backup\Stuff and then copy C:\Stuff to Z:\ to work around that.
    Using the unicode prefix \\?\ may work from the command line. So use \\?\X:\Servername\date-backup\Stuff\ (See this article for info).

    I think Robocopy will work with longer paths. Included with Vista, or a version that will work on XP can be downloaded here as part of the Server 2003 Resource Kit.

    As you mentioned you are copying from a Server, you may already have Robocopy.

    HTH

    Jerry
     
  7. prephil

    prephil Thread Starter

    Joined:
    Feb 9, 2007
    Messages:
    53
    Thanks Mr. Newton. Will try this in the a.m. and let you know how it goes.
     
  8. prephil

    prephil Thread Starter

    Joined:
    Feb 9, 2007
    Messages:
    53
    Hi Jerry,

    Was copying and pasting. There weren't any files exceeding 200 characters, I know that. I'm going to give codesector a try first and failing that I'll try robocopy, Thanks for your advice.

    God bless,

    Phil.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/765504

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice