Copy directory command line

by admin on November 25, 2010

Windows has two command line utilities to copy files/directories from command line. Copy command can be used to copy files from one folder to another folder. It can’t be used to copy a complete folder to another location on the disk. Xcopy allows us to do this. Let’s see how we can copy a directory along with all the files and sub directories to another location.

Xcopy /E /I SourceFolder DestinationFolder

Let’s say we need to copy a directory called C:\dir1\sourcedir to a location named D:\data\destinationdir.

Now you can run the below command to copy the complete sourcedir to D:\data\destination

Xcopy /E /I C:\dir1\sourcedir D:\data\destinationdir

In the above command we can also use relative paths of the folders with respect to the current directory.

{ 1 comment… read it below or add one }

Sam January 3, 2014 at 3:30 pm

yOU Are the Best….i just tried it now…it came very handy wen i needed it…

Reply

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: