Problem with batch file for backup using xcopy

R

Rob

I have set up a batch file to backup my documents, mail and desktops.

xcopy e:\robindox t:\robindox /s /d /y /i /k /h /w /EXCLUDE:c:\a.txt
xcopy e:\transdox t:\transdox /s /d /y /k /i /h /EXCLUDE:c:\a.txt
xcopy m:\eudora t:\eudora /s /d /y /k /i
xcopy c:\docume~1\robin\desktop\ t:\robin\desktop /s /d /y /k /i
xcopy c:\docume~1\transl~1\desktop\ t:\translat\desktop /s /d /y /k /i

The first three lines run perfectly, but the last two produce errors,
but the command window closes instantly and I cannot read the error
messages.

I have tried using the full names instead on xxxxxx~1 but the result
is the same.

Any help much appreciated.

Robin
 
M

mikeboggs

Rob said:
I have set up a batch file to backup my documents, mail and desktops.

xcopy e:\robindox t:\robindox /s /d /y /i /k /h /w /EXCLUDE:c:\a.txt
xcopy e:\transdox t:\transdox /s /d /y /k /i /h /EXCLUDE:c:\a.txt
xcopy m:\eudora t:\eudora /s /d /y /k /i
xcopy c:\docume~1\robin\desktop\ t:\robin\desktop /s /d /y /k /i
xcopy c:\docume~1\transl~1\desktop\ t:\translat\desktop /s /d /y /k /i

The first three lines run perfectly, but the last two produce errors,
but the command window closes instantly and I cannot read the error
messages.

I have tried using the full names instead on xxxxxx~1 but the result
is the same.

Any help much appreciated.

Robin


I recommend trying to use the full names the xxxxx~1 BUT put them in
quotes.

xcopy"C:\Documents and Settings\robin\whatever" "T:\whatever"
/s/d/y/k/i

Let me know if that helps.
 
R

Rob

I recommend trying to use the full names the xxxxx~1 BUT put them in
quotes.

xcopy"C:\Documents and Settings\robin\whatever" "T:\whatever"
/s/d/y/k/i

Let me know if that helps.
Tried it, Mike, but no joy.

This is my file, now:

xcopy e:\robindox t:\robindox /s /d /y /i /k /h /w /EXCLUDE:c:\a.txt
xcopy e:\transdox t:\transdox /s /d /y /k /i /h /EXCLUDE:c:\a.txt
xcopy m:\eudora t:\eudora /s /d /y /k /i
xcopy "c:\documents and settings\robin\desktop\" t:\robin\desktop /s
/d /y /k /i
xcopy "c:\documents and settings\translation\desktop\"
t:\translat\desktop /s /d /y /k /i

Documents and settings seems to be the problem. I could change the
name of the user. My Documents are on the e: drive, as you can see,
but afaik you can't move the desktop. (istr that you could do it with
tweakui in W98, but not on XP)
 
R

Rob

Tried it, Mike, but no joy.

This is my file, now:

xcopy e:\robindox t:\robindox /s /d /y /i /k /h /w /EXCLUDE:c:\a.txt
xcopy e:\transdox t:\transdox /s /d /y /k /i /h /EXCLUDE:c:\a.txt
xcopy m:\eudora t:\eudora /s /d /y /k /i
xcopy "c:\documents and settings\robin\desktop\" t:\robin\desktop /s
/d /y /k /i
xcopy "c:\documents and settings\translation\desktop\"
t:\translat\desktop /s /d /y /k /i

Documents and settings seems to be the problem. I could change the
name of the user. My Documents are on the e: drive, as you can see,
but afaik you can't move the desktop. (istr that you could do it with
tweakui in W98, but not on XP)

I added a pause at the end so I can now read the error messages.

They are "Invalid path" for both lines.
 
R

Rob

Tried it, Mike, but no joy.

This is my file, now:

xcopy e:\robindox t:\robindox /s /d /y /i /k /h /w /EXCLUDE:c:\a.txt
xcopy e:\transdox t:\transdox /s /d /y /k /i /h /EXCLUDE:c:\a.txt
xcopy m:\eudora t:\eudora /s /d /y /k /i
xcopy "c:\documents and settings\robin\desktop\" t:\robin\desktop /s
/d /y /k /i
xcopy "c:\documents and settings\translation\desktop\"
t:\translat\desktop /s /d /y /k /i

Documents and settings seems to be the problem. I could change the
name of the user. My Documents are on the e: drive, as you can see,
but afaik you can't move the desktop. (istr that you could do it with
tweakui in W98, but not on XP)


EUREKA!

The problem was it didn't like the final backslash in the path!
 
M

mikeboggs

Rob said:
EUREKA!

The problem was it didn't like the final backslash in the path!


That was my next recommendation, but you beat me to it! ;)
Glad you got it going.
 
S

Stan Brown

Fri, 08 Sep 2006 14:30:15 +0100 from Rob <f8YRm9
@spambobLEAVETHISBITOUT.net>:
I have set up a batch file to backup my documents, mail and desktops.

xcopy e:\robindox t:\robindox /s /d /y /i /k /h /w /EXCLUDE:c:\a.txt
xcopy e:\transdox t:\transdox /s /d /y /k /i /h /EXCLUDE:c:\a.txt
xcopy m:\eudora t:\eudora /s /d /y /k /i
xcopy c:\docume~1\robin\desktop\ t:\robin\desktop /s /d /y /k /i
xcopy c:\docume~1\transl~1\desktop\ t:\translat\desktop /s /d /y /k /i

The first three lines run perfectly, but the last two produce errors,
but the command window closes instantly and I cannot read the error
messages.

EITHER run the batch file from inside a command window OR put this
line after every line of the batch file:
if errorlevel 1 pause
That will pause the file only if xcopy reports an error.
 

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

Similar Threads


Top