How to XCOPY WITH path structure ???

How to XCOPY WITH path structure ???

Post by Tom Mill » Mon, 18 Aug 2003 01:26:18



If I copy a part of a directory tree I want xcopy to create exactly the path
in the target directory. In other words if I perform:

FOR /F "tokens=*" %%a in (xcopydirs.txt) do xcopy %%a\*.* /s /y E:\backup\%%a

doesn't work because the target is resolved to E:\backup\D:\project1
which is not a correct target dir.

The contents of xcopydirs.txt is e.g.
D:\project1\data
D:\project2
D:\project244

What I want to achieve is that in the target dir later the structure is as follows:

E:\backup\project1\data\.....
E:\backup\project2\....
E:\backup\project244\....

How do I solve the problem ?

Thx
Tom

 
 
 

1. Better XCOPY than XCOPY

  Hello,
 I've recently started working on a better XCOPY than XCOPY.  I've got
some ideas regarding archiving schemes and not copying if the file
won't fit in destination drive. I hate those Disk Full errors.  Anyhow
I'm down to the part where I need to write a copy function. I'd like
to check the available memory and then copy as many files as will fit
into memory.  Then I'd write from memory to disk. This is what COPY
and XCOPY seem to do.  The problem is that I'm relatively new to DOS
and this whole problem of having a segmented memory. Is there some
conventionally accepted way to perform FAST, EFFICIENT copying
enmasse? I'm using both Turbo C++ and MSC 6.0 (NOT intermixed, but
parallel). Thanks!

Brian Downing   VAX User Assistant,  Fordham University, New York, New York

void random_witticism(char *, ... ) { ... }

2. News: robot slug-destroyer

3. structures and structure pointers

4. AppleWin keyboard joystick

5. Structure ->Structure [?mildly offtopic] and other Newbie Concerns

6. A2000 upgrade:

7. DJGPP STRUCTURE SYNTAX AND RULES FOR STRUCTURE POINTERS

8. Compiling DLLs and free C compiler

9. PATH vs. application paths; opening explorer in current folder

10. Set path=C:\Djgpp\BIN;%PATH% ?

11. set path=%path%;c:\myutil

12. How to ADD a path to the existing path in DOS 5.0?

13. mac paths to dos paths