Xcopy failure

  • Thread starter Thread starter Rich Hilmer
  • Start date Start date
R

Rich Hilmer

Hi,
I have several batch files that copy files over the network to a share. 99%
of the time they work perfectly. Occasionally a file just does not get
copied. I have redirected the output of the batch file to a file for
reference, and the copy just seems to stop.

e.g. if the source dir contains My1.exe through My4.exe, and x: is mapped to
a share I have permission to write to:

xcopy /y /v My*.exe x:\dest
echo done

the output might be like this:

c:My1.exe
c:My2.exe
done

i.e. some of the files are not copied.

So:
1) What is happening?
2) Is there a workaround? Perhaps an xcopy alternative that is more
reliable?

Thanks in advance,
Rich.
 
Well, it seems that the error message from xcopy doesn't go to the
redirected log file. Hmmm.. Oh, redirection with > is catching the standard
output (stdout) from the program, but not the error output (stderr).
Different output sources from the program.

Check this for a possible aid. http://www.teaser.fr/~amajorel/stderr/

To keep the process from just crashing on you, also use the flag /c to
continue copying even if there are errors.
Val
~~~~~~~~~~~~~~~~~~~~~~~~~~~
www.sdsmt.edu
The best little engineering school you
may not have heard of, but should have!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hi,
I have several batch files that copy files over the network to a share. 99%
of the time they work perfectly. Occasionally a file just does not get
copied. I have redirected the output of the batch file to a file for
reference, and the copy just seems to stop.

e.g. if the source dir contains My1.exe through My4.exe, and x: is mapped to
a share I have permission to write to:

xcopy /y /v My*.exe x:\dest
echo done

the output might be like this:

c:My1.exe
c:My2.exe
done

i.e. some of the files are not copied.

So:
1) What is happening?
2) Is there a workaround? Perhaps an xcopy alternative that is more
reliable?

Thanks in advance,
Rich.
 
Back
Top