Windows Command Study: xcopy

Source: Internet
Author: User

Original article link

Copy directories and Their subdirectories and files (except for implicit and system files ).

Use this command to copy all the files in a directory, including all the files in the subdirectories of the directory.

Syntax:

Xcopy source [destination] [/y] [/-y] [/A |/m] [/D: DATE] [/P] [/s [/E] [/V] [/W]

Parameters:

Source
Specifies the name and location of the file to be copied. It must contain the drive or path.

Destination
Specifies the target location of the copy, which can contain drive letters and colons, directory names, file names, or their combinations.

Switch:

/Y
Specify that xcopy is not confirmed when the original file is replaced. By default, if the target file already exists, xcopy will ask you to confirm whether to replace the original file (the old version of the MS-DOS overwrites the original file ). If the xcopy command is executed in a batch file, the xcopy operation is performed in the old version without security confirmation. This switch overwrites the current settings of all default values and copycmd environment variables.

/-Y
Specify to allow xcopy to confirm when replacing the original file. This switch overwrites the current settings of all default values and copycmd environment variables.

/
Copy only the source files whose file attributes have been set. This switch does not modify the file attributes of the source file. For details about how to set attributes of an archive file, see the attrib command.

/M
Copy the source file that has been set for the file properties. Unlike the/a switch, the/M switch disables the file attributes of the source file. For details about how to set attributes of an archive file, see the attrib command.

/D: Date
Only the source files modified after the specified date are copied. Note that the standard format of the date depends on the country setting in use.

/P
When you create a target file, you are prompted to confirm the file.

/S
Copy directories and subdirectories unless they are empty. If you ignore this switch, xcopy only works within a single directory.

/E
Copy directories and subdirectories even if they are empty. If you ignore this switch, xcopy only works within a single directory.

/V
Check whether the target file and source file are identical each time you write the target file.

/W
Before copying an object, the following information is displayed and you are waiting for an answer:

Press any key to start file copy.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.