Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi. I have to copy a directory, which has about 100 subdirectories. What is the switch to copy those as well? I've been trying to use "copy *.* d:\dir /e". But /e isn't a valid switch. Weird because that's what I've always used.
Am I way off here? Thanks..
CJ

The command you want ain't COPY, but XCOPY.
I believe you always used it, because you're using the right sintax.-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

Using xcopy will work but you need to have
/s to copy subdirectories
xcopy form to /s
example: xcopy c:\windows\*.* e:\ /s

I'm sorry, but I disagree with you, Keith.
It's the /S is NOT necessary since he is already using the /E switch (which is the same this as /S/E) This switch copyies all the subdirectories, INCLUDING THE EMPTY ONES (the /s doesn't make that)
Xcopy *.* d:\dir /e
Will copy ALL subdirectories from current directory within their files (as well as the files from the current directory) to d:\dir
For more information:
xcopy /?-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

Thank you both very much for your help. I love it when it turns out to be something so simple! Can't believe I was using copy instead of xcopy.
Anyways - all is well. The only snag I hit was trying to copy everything with the exception of one file, but no biggie.
Thanks again.
CJ

That's o.k. for you, but others reading the post might get the wrong idea. To copy C:\DIR and all its subdirectories to D:, you need to first make a DIR directory on D: or XCOPY will put the files from C:\DIR on D:\.
Then when you have a similar DIR directroy on D: You enter XCOPY C:\Dir D:\DIR /S. (The reason to use /S is because /E does not work on all versions of MS-DOS--6.00 has the problem with it I believe)

FRED6008: I see your point on the /S switch.
I think we're having a version conflict here in other point:
On Dos7 XCOPY, the destination directory does NOT need to exist. Xcopy will just prompt if d:\dir is a filename or a directory. Even if there is already a file named "dir" at D:\ it will make that prompt.
Perhaps you're taking as base a xcopy from other version of Dos ?
-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |