Windows Copy Operation With Xcopy Command Tutorial With Examples

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/windows-copy-operation-xcopy-command-tutorial-examples/
PINTEREST
PINTEREST
INSTAGRAM

Windows have different tools and commands to copy file, folders and subfolders. Xopcy is one of the most popular copying command. Xcopy comes builtin with all Windows operating systems. In this tutorial we will look different usage types and examples of Windows xcopy command.

Help

Help about xcopy command can be get with the following.

Help

Help

Copy File

Basic usage of the xcopy command is copying gives file. We will just specify the source file and destination file name and path. We can also specify in relative paths like below.

Copy File

Copy File

While copying we specify the source as sfile with F . After copy operation is completed information about the operation is printed like file count source file name etc.

Copy Folder

Copy folder is an other useful feature of the xcopy command. We will copy cygwin64 source folder as new_cygwin64 in the example below.

Copy Folder

Copy Folder

Copy Recursively All Folder and SubFolders

In previous example we have given the source folder. The only file contents of the source folder is copied in to the destination folder. We can use /S option to copy all folders, sub folders and related files recursively like below.

Copy Recursively All Folder and SubFolders

Copy Recursively All Folder and SubFolders

As we can see from screenshot all sub folders and files are copied.

Prompt Before Starting Copy

Another useful feature is prompting before starting copying. This will prevent accidental copying or unwanted overwriting of destination files and folders. We will use /W option for this feature.

LEARN MORE  How To Navigate, List Files and Directories In Windows Command Line With Dir

Prompt Before Each File Creation

Another alternative for user acceptation by prompting is prompting in each file creation. This may be a useful feature for some file and folder copy but in bulk operation this is not so useful. We will use /P option to prompt for each file copy operations like below.

Prompt Before Each File Creation

Prompt Before Each File Creation

Copy Files With Archive Attributes

While copying files by default some files attributes are not copied. Archive attributes are some of them. We can enable copying archive attributes with /A option like below.

Copy Hidden and System Files

Hidden and System files are important part of the operating systems. They are use by Windows operating system internally. If we are making copy on these type of files they are not copied by default. We cna enable copying them with /H .

Copy Files Those Changed After Specific Date

For copy operations those are done same period there are some useful features which will make copy more efficient. We can specify some date and time where these will be used to which files will be copied after that time. In this example we will only copy files those are changed after 01-01-2017

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/windows-copy-operation-xcopy-command-tutorial-examples/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)