XCopy Failure

B

Brian Smith

I am trying to use XCOPY in a batch file to copy a
directory several levels deep to another drive and
therefore the command line is long. When running the batch
file I get an error message indicating that the program is
too big to fit into memory.

Any ideas?
 
R

Rob Schneider

Brian said:
I am trying to use XCOPY in a batch file to copy a
directory several levels deep to another drive and
therefore the command line is long. When running the batch
file I get an error message indicating that the program is
too big to fit into memory.

Any ideas?

What is the exact command you are executing? Can you paste it in here.
 
B

Brian Smith

Rob: Here it is in all its glory:

xcopy /y /s /m "c:\Documents and
settings\default\Application Data\Mozilla\*.*"
"d:\Application Data\"

Note that in the batch file it is all on one line and ther
is a space between the 2 directory names.

What do you think?
 
R

Rob Schneider

Brian,

I would recommend doing as the documentatin says, and put the switches
after the "source" and "destination". And to be conservative (although
it probably makes no difference) I would use the same UPPERCASE for the
switches as suggested in the documentation. See "xcopy /?"

These folder source/destination are not long at all and are not the
cause of the problem.

this work?
rms
 
B

Brian Smith

I tried puting the command line switches at the end and
upper-casing them, but still no success. I get the message
"program too big to fit into memory"

Interestingly, if I manually generate a command prompt and
run the command, it works fine. It must have something to
do with batch file processing.

Still stuck.
 
R

Rob Schneider

Try:

:in command prompt box, type 'mem' and see what it says. On my machine
I have 599344 for "largest executable program size". Is yours diffent?

:try doing some simple xcopy's just to get it going.

:are there other things in the batch file? Is it the batch file giving
the error, or the xcopy commands?

:if you can get a copy of the NT 4 Resource kit, get 'robocopy' and stop
using xcopy. robocopy is a terrific synchronisation program.

:just to be differnt, in your tests, remove /Y and /M switches as they
not really needed to prove it will work.

:I notice I don't have a C:\Documents and Settings\default folder. My
Mozilla stuff is elsewhere. Are you sure you have this folder structure.

:Do you really want to copy all this stuff? For mozilla, I think the
only important folder is the one where the bookmarks, cookies, etc. are
store and. thats a single folder. Why not just copy that folder? Or
perhaps you are doing something different?

I'm out of ideas.
 
B

Brian Smith

It says " 633,424 largest executable program size".

The batch file has 11 simpler "xcopy" lines ahead of the
one I quoted and one even longer one following.

All of the shorter lines execute perfectly. The one I
quoted and the one following do not with the same error
message.

Just for fun, I tried putting the long ones first to see
what happens. still failed.

And I'm still baffled!
 
R

Rob Schneider

Brian Smith wrote:

I don't know either. I've used xcopy a lot over the years, and never
had a problem (except to get the switches right).

If you are tring to synchronize folders/files from one place to another,
maybe just dump xcopy and try unison. see
http://www.cis.upenn.edu/~bcpierce/unison/
 
B

Brian Smith

I'll give it a look-see.

I am going to keep experimenting with xcopy. If I every
come up with the solution to the problem, I'll let you know
so you can help someone else.

Thanks.

Brian
 
T

Ted

Rob Schneider said:
Brian Smith wrote:

I don't know either. I've used xcopy a lot over the years, and never
had a problem (except to get the switches right).

If you are tring to synchronize folders/files from one place to another,
maybe just dump xcopy and try unison. see
http://www.cis.upenn.edu/~bcpierce/unison/

Did Brian write that, or did you? If it was you, then your claim, "I don't know either." speak volumes!
 
B

Bob Harris

As you probably know, XCOPY itself is avery small program,
which can fit on a floppy many times over. So the error
can not mean that XCOPY is too large to fit into the
memory of a modern computer capable of running XP (or even
an old DOS machine). I have noticed that some file
operations in XP are sensitive to the total path lenght
including the file name. I believe that the limitationwas
there under 98, but I never seemed to hit it, maybe
because I was still using DOS-length pathes in those
days.

One way to fix such a problem is to change directory down
a few levels before issuing the XCOPY command. You can do
this easily within a batch script via the "CD" command.
If necesary you can stack CD commands, one per line to dig
down as far as necessary.

Good luck.

By the way, consider adding the /V option to XCOPY. It
checks that the copy is the same as the original (V is for
verify).
 

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