0

How can I copy folder in windows cmd. I would like to copy folder it self with files in it, not just files. When you use copy or xcopy commands they copy files but not folder name. xcopy folderOne folderTwo copy files in folderOne to folderTwo. Is there a way to copy folderOne to folderTwo, so the folder structure will be folderTwo\folderOne.

This is easily done in windows explorer just by selecting folder and copy/paste to another destination.

I came from this question Commmand line command to copy entire directory (including directory folder) to another directory. There seams to be no right answer to this.

Thanks.

0

1 Answer 1

2

The following command should do what you're trying to accomplish:

xcopy folderOne folderTwo\folderOne /i /s
2
  • As I set your are creting new drive, folderTwo\folderOne. I would like to copy whole folder/dir, not to create new one.
    – IGRACH
    Commented Aug 18, 2016 at 7:56
  • 1
    @IGRACH That's exactly what you asked for in your question ...
    – DavidPostill
    Commented Aug 18, 2016 at 16:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .