using DOS, I'd like to copy one directory to another. For example there is directory C:/test and C:/test2.

I'd like to copy C:/test into C:/test2 so that the result will be C:/test2/test

Everything I've found so far will only copy the files and folders contained in C:/test into C:/test2, but leaves out the parent directory

Thanks,

link|improve this question
1  
try to use xcopy – Sandeep Singh Rawat Nov 1 '10 at 21:53
feedback

migrated from stackoverflow.com Nov 2 '10 at 3:00

This question came from our site for professional and enthusiast programmers.

4 Answers

Try using XCOPY with the /E switch. More info here.

I haven't had to access this information from my brain in years!

link|improve this answer
1  
The '/T' switch on Xcopy will do a directory & subdirectory structure copy without any files. – mfg Nov 9 '10 at 16:33
RE: /T switch, that can be extremely useful sometimes. Granted, it does not come up often, but when it does, wow does knowing that trick come in handy! :) – Bobson Mar 11 at 19:59
feedback

xcopy c:\test c:\test2\test /s /e /h

Here is info on XCOPY

link|improve this answer
feedback

I recommend robocopy over xcopy, as it has a lot more options, including keeping timestamps intact, which I find essential.

Robocopy needs to be added on XP/2003, but it is standard from Vista onwards.

I actually usually use xxcopy, but the 64-bit version is not free.

link|improve this answer
robocopy is a Windows program. The question was about DOS. – grawity Nov 2 '10 at 20:52
@grawity: The likelihood of him actually using 16-bit DOS is very small compared to the high probability of him calling CMD 'DOS', as is common in the real world. – paradroid Nov 3 '10 at 8:31
feedback

This will do that from the GUI, don't know how they do it.

"...small program will allow you to select the "from directory" and "into directory", and it will proceed to copy ONLY the directory structure."

http://www.rjlsoftware.com/software/utility/treecopy/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown