Robocopy - Copy directory into another directory

ng.newbie

I can't believe that I am having trouble in copying a directory into another directory via the windows command line.

What I want to do is simple -:

Lets say I have a directory -:

C:\test

and I want to copy test to D: So in D there should be a folder like the following-:

D:\test

when I use

robocopy C:\test D:\test \E

D drive ends up with the contents of C:\test in the root rather than being contained in a directory called test.

How do you do this simple thing ?

SDsolar

If you want to create an exact duplicate, use the following version (which is equivalent to adding /E and /PURGE:

robocopy c:\source d:\destination /MIR

If all you want to do is copy the directories and subdirectories including empty ones, use

robocopy c:\source d:\destination /E

It is the backslash on the E option that was getting you.

To learn more about Robocopy here is a handy search:

http://www.google.com?q=robocopy+syntax

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

robocopy or xcopy: copy directory and files

Robocopy copy directory instead of just its content

Robocopy in CMD Doesn't Copy the Parent Directory

CentOS: Copy directory to another directory

Copy files in a directory to another directory

Ansible: copy a directory content to another directory

copy directory into another directory multiple times

Copy entire directory contents to another directory?

Copy directory to another directory using ADD command

Copy only the contents of a directory into another directory

Copy Multiple Directories into One Directory Keeping the root folder using Robocopy

find a file and copy it to another directory

find a file and copy it to another directory

Copy directory from another branch

Copy certain directories to another directory

Command to copy a file to another directory

BASH copy to another directory not working

Command to copy a file to another directory?

how to copy a directory (folder and its contents) to another directory?

Unix Command to copy the unique files from one directory to another directory

How to copy matching files from directory/subdirectory to a another directory

Trying to copy files with multi-patterns from directory to another directory?

Copy files to another directory containing the same directory structure in bash

How to copy SELinux context from one directory and apply it to another directory?

How do i copy files from one directory to another directory?

How to copy first n images from a directory to another directory?

Edit all files in a directory and save as another copy

Dockerfile copy jar file from another directory

How to copy only folders from a directory into another