PDA

View Full Version : Backup Batch File


Ron Boetger
June 5th 04, 04:21 PM
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

Alex Nichol
June 6th 04, 01:44 PM
Ron Boetger wrote:

>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

--
Alex Nichol MS MVP (Windows Technologies)
Bournemouth, U.K. (remove the D8 bit)

Ron Boetger
June 7th 04, 02:54 PM
That did the trick - Thanks

Ron

On Sun, 06 Jun 2004 12:44:41 +0100, Alex Nichol
> wrote:

>Ron Boetger wrote:
>
>>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

Google