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.