Backup Batch File

R

Ron Boetger

I want to create a batch file that will copy all of the contents of
the My Documents directory on the C:/ Drive to the D:\ Drive.

Here is what I is in the batch file I created - but it does not work.

XCOPY C:\Documents and Settings\username\my documents *.*
D:\Documents and Settings\username\my documents /E/C/Y/I/H

Any Ideas what I am doing wrong?

Thanks

Ron
 
M

MGGP

1) You need a backslash after the first My Documents, OR
2) just leave off the *.*


Good Luck !
 
R

Ron Boetger

Made the change. Now I get an error "Invalid Numbers of Parameters!"

Any Ideas?

Thanks

Ron
 
R

Ron Boetger

Here you go!

XCOPY C:\Documents and Settings\rboetger\my documents\*.*
D:\Documents and Settings\rboeger\my documents /E/C/Y/I/H
 
A

Alex Nichol

Ron said:
Here is what I is in the batch file I created - but it does not work.

XCOPY C:\Documents and Settings\username\my documents *.*
D:\Documents and Settings\username\my documents /E/C/Y/I/H

Any Ideas what I am doing wrong?

Where you have a path\file that has spaces in it, you must hold it
together with quotes. And you left out a \ before the *.* wild card for
the files - so

XCOPY "C:\Documents and Settings\username\my documents\*.*"
"D:\Documents and Settings\username\my documents" /E/C/Y/I/H
 
J

John A

Try adding 4 double quotes as follows

XCOPY "C:\Documents and Settings\rboetger\my documents\*.*"
"D:\Documents and Settings\rboeger\my documents" /E/C/Y/I/H

John Allen
 
R

Ron Boetger

That did the trick - Thanks

Ron

Where you have a path\file that has spaces in it, you must hold it
together with quotes. And you left out a \ before the *.* wild card for
the files - so

XCOPY "C:\Documents and Settings\username\my documents\*.*"
"D:\Documents and Settings\username\my documents" /E/C/Y/I/H
 

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