Copying files with Long File names

T

Tom Stuart

I have a couple of computers networked. I thought that an easy way of
backing up was to copy My Documents across each of the computers. I keep
quite a few internet web pages, particularly ezine news articles. They seem
to have very long file names. When I try to copy them I get a "Filename too
long error". This makes no sense. How could they have been created in the
first place?

The most annoying part is that it crashes my attempts to copy all of my
documents. Is there some way I can get it to skip these files? I don't
want to delete them. They are nested down in sub-directories so it is not
possible to deselect them from the main copy command.

Tom Stuart
 
M

Mike Brearley

Try using a batch file to copy them.

xcopy works great, just use xcopy /e/c/h/y drive:\path\. newdrive:\path

e - copies all subdirectories (including empty ones, use s if you don't want
to copy empty directories)
c - continues on errors
h - copies hidden and system files (dragging and dropping a directory will
also copy hidden and system files with the directory)
y - confirms any overwrites

You'd have to use net use to map a drive letter to the drive on the remote
system, but that's easy too. If you respond to me and let me know that
exact directory for the source and the destination I can send you exactly
what you'd need. For the remote system, I'd need to know the computer name
and share name you are connecting to, or if you don't want to provide that,
you can fill in the appropriate names later.

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike
 
M

Matthew

Instead of using Copy and Paste, try using the backup program that is
provided with XP.

If you have XP Pro, it is installed by default. If you have XP Home, you
need to install it from the CD.

Go to start, run, and type "ntbackup" (without the quotes). You can check
the box by "my documents" to back it up, then navigate to your sub-folder
and un-check the folder or the files with long filenames.

Matthew
 
T

Tom Stuart

Thanks for your help. Here are the details your after (I hope I understood
what you require!)

The Group name is MSHOME
The source computer is Dads (Study)
Destination computer is Neralie (Videoed)

Source directory: is simply My Documents or for full pathname:
c:\Documents and Settings\Tom\My Documents and all subdirs below

Destination is: VideoEd Docs (that is the share name for My Documents on the
dest computer)\Backup of Study My Documents

That the info you want? Hope so ... thank you for you help thus far.

Tom
 
T

Tom Stuart

Plenty of help happens here!! Thanks :)

Tom


Matthew said:
Instead of using Copy and Paste, try using the backup program that is
provided with XP.

If you have XP Pro, it is installed by default. If you have XP Home, you
need to install it from the CD.

Go to start, run, and type "ntbackup" (without the quotes). You can check
the box by "my documents" to back it up, then navigate to your sub-folder
and un-check the folder or the files with long filenames.

Matthew
 
T

Tom Stuart

I've now had a look at Backup. It will only backup to a single file. That
is not really what I am after. I think Xcopy sounds like what I'm looking
for. Thanks anyway.

Tom
 
M

Mike Brearley

you'd need to use notepad and create a file (renaming it with a .bat or .cmd
extension)

-------
net use x: "\\neralie\Backup of Study My Documents"
xcopy /e/c/h/y "c:\Documents and Settings\Tom\My Documents\." x:
net use /d x:

--
Posted 'as is'. If there are any spelling and/or grammar mistakes, they
were a direct result of my fingers and brain not being synchronized or my
lack of caffeine.

Mike
 
F

F1Com

Tom said:
I have a couple of computers networked. I thought that an easy way of
backing up was to copy My Documents across each of the computers. I keep
quite a few internet web pages, particularly ezine news articles. They seem
to have very long file names. When I try to copy them I get a "Filename too
long error". This makes no sense. How could they have been created in the
first place?

The most annoying part is that it crashes my attempts to copy all of my
documents. Is there some way I can get it to skip these files? I don't
want to delete them. They are nested down in sub-directories so it is not
possible to deselect them from the main copy command.

Tom Stuart

Hi Tom,

It appears you have the answers to make the copy. I use xcopy for my
data backups to other drives within my system and to network drives.

The reason you are getting the error is the limitation of the
path/filename. The total path/filename length cannot exceed approx 255
characters (varies slightly between OS's). You are probably nestiing
your files into a deeper folder structure on the destination computer
and thereby creating a longer path/filename.

The mapping of the drive is a good suggestion as well as using xcopy.
Mapping the drive will cut down 30 to 40 characters of a path, which
should allow you to complete the copy operation.

Terry
 
T

Tom Stuart

Mike's instructions worked great and Terry has helped me understand why I
had the problem in the first place. Thanks folks.

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top