up vote 0 down vote favorite
share [g+] share [fb]

I have the following folders on a Windows machine

C:\FolderToCopy

C:\Dest

Both folders are empty.

I want to execute a copy operation from a command prompt so that I have this in the end:

C:\FolderToCopy

C:\Dest\FolderToCopy

In other words, I want to copy FolderToCopy so that it is now in the C:\Dest folder.

I know this should be easy - I do this often enough from the UI - but nothing I try seems to work.

link|improve this question
feedback

migrated from stackoverflow.com Mar 1 '10 at 15:41

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

3 Answers

up vote 0 down vote accepted

robocopy C:\FolderToCopy\ C:\Dest\FolderToCopy /E

link|improve this answer
That did the trick. Good ol' robocopy! – Tola Odejayi Mar 1 '10 at 17:38
feedback
XCOPY /S /Y C:\FolderToCopy C:\Dest\

The last slash is important.

link|improve this answer
I tried this (even with the last slash) but it didn't work. – Tola Odejayi Mar 1 '10 at 15:48
feedback

Copy C:\FolderToCopy\. C:\Dest\FolderToCopy

link|improve this answer
No joy with this, either. – Tola Odejayi Mar 1 '10 at 15:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.