xcopy to copy from one drive to another

T

Tracy

I'm trying to create a batch file so that all my files on my 2nd hard drive
(which is F:) are copied to my external usb hard drive (which is G:)
Also...I want to NOT copy one file called gobackio.bin and the 2 folders
called Recycler and System Volume Information

I've tried using all the various ways that I can think of.
I've copied the line that I use for another xcopy but it still won't work
I want to keep the same variables at the end
xcopy F:\ G:\ /y/i/s/h/

but....that line just won't work. All I can get (from a screen shot) is
this that shows in the window:
F:\zBackups>xcopy F:\ G:\ /y/i/s/h
F:\gobackio.bin

and...there it ends...no copying is done at all.
I've tried using:
xcopy F:\*.* G:\ /y/i/s/h
xcopy F:\* G:\ /y/i/s/h
xcopy F:\*.* \G:\ /y/i/s/h
xcopy F:\ \G:\ /y/i/s/h
xcopy F:\*.* G: /y/i/s/h\
and, I think all other variations of that.

What am I doing wrong?

Tracy
 
S

Shenan Stanley

Tracy said:
I'm trying to create a batch file so that all my files on my 2nd
hard drive (which is F:) are copied to my external usb hard drive
(which is G:) Also...I want to NOT copy one file called
gobackio.bin and the 2 folders called Recycler and System Volume
Information
I've tried using all the various ways that I can think of.
I've copied the line that I use for another xcopy but it still
won't work I want to keep the same variables at the end
xcopy F:\ G:\ /y/i/s/h/

but....that line just won't work. All I can get (from a screen
shot) is this that shows in the window:
F:\zBackups>xcopy F:\ G:\ /y/i/s/h
F:\gobackio.bin

and...there it ends...no copying is done at all.
I've tried using:
xcopy F:\*.* G:\ /y/i/s/h
xcopy F:\* G:\ /y/i/s/h
xcopy F:\*.* \G:\ /y/i/s/h
xcopy F:\ \G:\ /y/i/s/h
xcopy F:\*.* G: /y/i/s/h\
and, I think all other variations of that.

What am I doing wrong?

Use Microsoft SyncToy...
 
M

Mistoffolees

Tracy said:
I'm trying to create a batch file so that all my files on my 2nd hard drive
(which is F:) are copied to my external usb hard drive (which is G:)
Also...I want to NOT copy one file called gobackio.bin and the 2 folders
called Recycler and System Volume Information

I've tried using all the various ways that I can think of.
I've copied the line that I use for another xcopy but it still won't work
I want to keep the same variables at the end
xcopy F:\ G:\ /y/i/s/h/

but....that line just won't work. All I can get (from a screen shot) is
this that shows in the window:
F:\zBackups>xcopy F:\ G:\ /y/i/s/h
F:\gobackio.bin

and...there it ends...no copying is done at all.
I've tried using:
xcopy F:\*.* G:\ /y/i/s/h
xcopy F:\* G:\ /y/i/s/h
xcopy F:\*.* \G:\ /y/i/s/h
xcopy F:\ \G:\ /y/i/s/h
xcopy F:\*.* G: /y/i/s/h\
and, I think all other variations of that.

What am I doing wrong?

Tracy

You are trying too hard. There are limitations to how to write
batch files whilst using wild cards. Omitting Recycler and the
System Volume Information will probably take care of themselves
since Windows XP will probably disallow their copying, in any event.
As for gobackbio.bin, consider assigning it an attribute that is
not routinely copied, such as a hidden system file?

An alternative would be to copy the file to Drive G and then
delete it from Drive G, such as, copy_f.bat, below:

rem copy_f.bat
rem copying Drive F to Drive G
xcopy f:\ g:\ /s /d /y
del g:\gobackio.bin
exit
 
T

Tracy

The problem to begin with is that the copying won't even start.

What is it in this line that is causing the copy to not even start then?
F:\zBackups>xcopy F:\ G:\ /y/i/s/h
 
T

Tracy

I found the problem...I had to remove the /h.
After I removed that, the copying is working.

Tracy
 
T

Tracy

Just found out though that my gobackio.bin won't copy (which I don't want it
to anyway), but I can't seem to exclude that file from the copy process.
ALL other files I want copied.
I know that the /h forces the xcopy to copy hidden and system files...which
is what I DO want. ALL of them...with one exception, the gobackio.bin.

How can XP Media Center edition do an xcopy with one excluded file?

Tracy
 
B

Bob Harris

To exclude files, use the XCOPY option called "/EXCLUDE". At a command prompt, type XCOPY /? for more information.

See sample below, which excludes all files described in EXCLUDE.TXT (There is nothing special about this name; any *.txt file could be used).

XCOPY F:\*.* D:\XFSAVE /S /V /H /D /R /EXCLUDE:EXCLUDE.TXT

contents of my EXCLUDE.TXT file:

\RECYCLED\
\SYSTEM VOLUME INFORMATION\

\TEMP\

You can also specify single files or files with specific extensions.
 
T

Tracy

I found my fix, i think...but I was waiting until I could fully confirm the
copy of ALL files and folders (empty or not) werer copied).
But, a few questions first:
1. What does the XFSave do????
2. Would the /D make the copying process faster?
3. Will the /V cause the copying process to take longer?
4. If I don't use /R, will those files not be copied?

I found my fix that was explained in much greater detail than MS states (see
link below):

My .bat file is this:
xcopy F:\ G:\ /y/e/i/s/exclude:monthly.txt

In the same folder at the .bat file is a .txt file called: monthly.txt
The montly.txt file, when I open it, says:
F:\gobackio.bin


Any line in the monthly.txt file will be excluded (which I WILL be adding
the Recycler and System Volume Information path on the next test run).
With that setup, I think all is working as it should now....hidden and
system files
are all being copied, with the exception of the file gobackio.bin.

I found the fix at:
http://www.brown.edu/Departments/Psychology/documentation/backup.html

Tracy

To exclude files, use the XCOPY option called "/EXCLUDE". At a command
prompt, type XCOPY /? for more information.

See sample below, which excludes all files described in EXCLUDE.TXT (There
is nothing special about this name; any *.txt file could be used).

XCOPY F:\*.* D:\XFSAVE /S /V /H /D /R /EXCLUDE:EXCLUDE.TXT

contents of my EXCLUDE.TXT file:

\RECYCLED\
\SYSTEM VOLUME INFORMATION\
\TEMP\
You can also specify single files or files with specific extensions.
 
T

Tracy

Reposting this question as this didn't get answered earlier:

1. What does the XFSave do????
2. Would the /D make the copying process faster?
3. Will the /V cause the copying process to take longer?
4. If I don't use /R, will those files not be copied?


Tracy
To exclude files, use the XCOPY option called "/EXCLUDE". At a command prompt, type XCOPY /? for more information.

See sample below, which excludes all files described in EXCLUDE.TXT (There is nothing special about this name; any *.txt file could be used).

XCOPY F:\*.* D:\XFSAVE /S /V /H /D /R /EXCLUDE:EXCLUDE.TXT

contents of my EXCLUDE.TXT file:

\RECYCLED\
\SYSTEM VOLUME INFORMATION\

\TEMP\

You can also specify single files or files with specific extensions.
 
T

Tim Slattery

Tracy said:
Reposting this question as this didn't get answered earlier:

1. What does the XFSave do????

In the example given, D:\XFSAVE is the destination. Files will be
copied from f:\*.* to D:\XFSAVE
2. Would the /D make the copying process faster?

It gives the program something to check on each file before copying,
that will slow things down. But it could result in copying many fewer
files, which will speed things up. So, it depends.
3. Will the /V cause the copying process to take longer?

Yes. The original and copy of each file must be compared.

4. If I don't use /R, will those files not be copied?

If you don't use /R, and a read-only file exists in the destination
directory, and a file with the identical name exists in the source
directory, it won't be copied. /R prevents read-only files in the
destination from being overwritten.
 

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