ComputersSoftware

The xcopy command: options

Xcopy - command console mode of the Windows operating system. It copies one or more files and / or folders from one place to another. It is also a command of the MS-DOS operating system. Thanks to the many options and the ability to copy entire directories, xcopy is similar to traditional copy, but it has much more capabilities. If more functionality is required, then the operating system has a robocopy command, which operates an even larger number of parameters.

Syntax

The format of the command line is as follows:

Xcopy source [ receiver ] [/ a] [/ b] [/ c] [/ d [: date ]] [/ e] [/ f] [/ g] [/ h] [/ i] [/ j] [ / K] [/ l] [/ m] [/ n] [/ o] [/ p] [/ q] [/ r] [/ s] [/ t] [/ u] [/ v] [/ w ] [/ X] [/ y] [/ -y] [/ z] [/ exclude: file1 [+ file2 ] [+ file3 ] ...] [/?]

The source specifies the name of the top-level file or folder from which to copy. This is the only required parameter of the xcopy command. If the file or directory name contains spaces, it should be enclosed in quotation marks.

A receiver, or target, is a parameter that indicates where the source files or folders should be copied. If it is not specified, the source will be stored in the same directory where the xcopy command is run. If the name of the destination contains spaces, it should be enclosed in quotation marks.

/ A

If you use this option, only the archive files found in the source will be copied. You can not use / a and / m at the same time.

/ B

This parameter is used to copy a symbolic link, not the one, but what it refers to. First appeared in Windows Vista.

/from

This option forces xcopy to continue running even if an error occurs.

/ D [: date]

The xcopy command with / d option followed by a specific date in MM-DD-YYYY format is intended for copying files modified on the specified day or later. You can also use this parameter without a specific time value to select only those parts of the source that are newer than documents with the same name in the receiver. It is used to perform normal file backup .

/ E

When used alone or with the / s option, the action of the parameter is the same as / s, but also creates empty folders in the receiver, if they were at the source. The / e switch can also be used with / t. This allows you to include the empty directories and subdirectories found in the source directory in the directory structure created at the destination.

/ F

This option displays the full path and name of the source and target files.

/ G

Using xcopy with this option, you can copy the encrypted files from the source to a receiver that does not support encryption. The key will not work when replicating data from an EFS disk to another encrypted disk of a different type.

/ H

Xcopy does not by default copy hidden or system files, but with this option can do it.

/ I

This option is used to prevent xcopy from asking whether the recipient is the file or directory. If you do not apply this option and copy from a source that is a directory or a group of files to a non-existent destination, the utility will prompt you to specify what the target object is.

/ J

This option copies files without buffering. This function is useful for very large amounts of data. For the first time this parameter xcopy appeared in Windows 7.

/ K

The option is used when copying files that are read-only so that this attribute is stored at the destination.

/ L

This parameter xcopy should be used to show a list of files and source folders, but the actual copying is not actually performed. The option will be useful in case of creating a complex command with several keys. In this case, the user can see the prospective work xcopy.

/ M

This option is identical to the / a option, but after copying, the xoron command disables the archive attribute. In all other cases, this attribute will be assigned to all files in the receiver, regardless of whether they were in the source. You can not use / m and / a at the same time.

/ N

This option creates files and folders in the receiver using short names. This option applies only when copying to an existing destination on a drive formatted on an older file system, such as FAT, which does not support long names.

/about

Saves information about the owner and access control list (ACL) in the copied files.

/R

When using this option, the user will have to confirm the creation of each target file.

/ Q

The option is the opposite of / f. This parameter xcopy switches the execution to "silent" mode, disabling the display of information about each copied file.

/ R

This option is used to overwrite files that are read-only at the destination. If this parameter is not applied when updating the data in the receiver, an Access denied message will be displayed and the xcopy command will stop the operation.

/ S

The option is used to copy folders with files and subdirectories in addition to the contents of the source root directory. Empty directories will not be created.

/ T

This parameter xcopy causes the command to create a directory structure in the receiver, but not to copy any of the files. In other words, the folders and subdirectories found in the source will be migrated, but without their contents. Empty directories are not created.

/ U

The parameter will only copy source files that are already at the destination.

/ V

This parameter activates checking the size of each recorded file to confirm its identity. Verification was built into the xcopy command, starting with Windows XP, so in later versions of Windows this option does nothing and is only enabled for compatibility with MS-DOS.

/ W

The parameter is used to display the message "Press any key when ready to be copying file (s)" ("Press any key when ready to copy the file (s)"). In this case, xcopy begins to execute the instructions only after confirming the operation by pressing the key. This option does not duplicate the / p switch, which activates the confirmation of copying each file.

/ X

This option copies the file audit settings and information about the system access control list (SACL). When the / x option is used, the / o switch is executed.

/ Y

The option is used so that the xcopy command does not request confirmation of overwriting files from the source already existing in the receiver. Conversely, the / -y parameter forces the overwrite requests. This key may seem redundant, since this behavior of the xcopy command is laid out by default, but the / y option on some computers can be specified in the COPYCMD environment variable, which causes this parameter.

/ Z

The option allows the xcopy command to safely stop copying when a network connection is lost, and then resume from the point where it was stopped after the connection is restored. This key also activates the output of the percentage of saving each file during the task execution.

/ Exclude: file1 [+ file2] [+ file3]

This parameter allows you to specify one or more file names containing a list of search strings that the xcopy command should skip when copying.

/?

When using this key, a detailed help will be displayed. Executing xcopy /? Similar to the help xcopy command. The user can save the output, which is sometimes very long, in the file using the redirection operator.

Examples

  • Xcopy C: \ Files E: \ Files / i

In the above command, the data contained in the source directory C: \ Files is copied to the destination, which is the new Files folder [/ i] on drive E. No subdirectories or files contained in them will be replicated because they were not used Key / s.

  • Xcopy "C: \ Important files" D: \ Backup / c / d / e / h / i / k / q / r / s / x / y

In this example, the command is used for backup. This combination of keys successfully replaces the software that provides data security. The specified command can be written to a batch file, and in the task manager assign it daily automatic execution. In this way, you can ensure regular data backup.

The above command line means that xcopy is used to copy all files and folders [/ s] whose date is newer than those already in the receiver [/ d], including empty [/ e] and hidden [/ h], from Source C: \ Important files to the target object D: \ Backup, which is the directory [/ i]. In addition, there are read-only data that should be replicated [/ r] with this attribute retained after writing [/ k]. Also, all access control settings [/ x] must be saved. Finally, since xcopy should be run in batch mode, there is no need to display information about the copied objects [q], as in the confirmation of overwriting each of them [/ y]. Stopping when an error occurs is also undesirable [/ c].

  • Xcopy C: \ Video "\\ SERVER \ Media Backup" / f / j / s / w / z

Here the xcopy command is used to copy all the folders with files contained in the subdirectories [/ s] from the "C: \ Video" source to the target directory "Media Backup" located on the network on a computer called SERVER. Since the video is saved really large, the buffering [/ j] is disabled to improve the process, and since this happens over the network, it is possible to resume copying if the connection is lost [/ z]. In this case, the user wants to receive a request to confirm the start of the process before xcopy actually does something [/ w], and also wants to see detailed information about which files are written [/ f].

  • Xcopy C: \ Client032 C: \ Client033 / t / e

In this example, there is a source with a well-organized directory of the current client in C: \ Client032. In this case, the Client033 folder for the new client has already been created, but the user does not want to copy the files, but only the directory structure [/ t], in order not to do it manually. In addition, C: \ Client032 has several empty directories that you might need for a new client, so make sure that they are also played [/ e].

Availability

The command can be called from the command line of all Windows operating systems, including Windows 8, 7, Vista, XP, 98, etc. Also xcopy is supported by the MS-DOS operating system. It should be noted that the availability of some parameters of the command and its syntax in different OSes may differ.

Options

In Windows 98 and 95, two versions of the command are available: xcopy and xcopy32. However, the last one was never intended to be run directly. When xcopy runs on Windows 95 or 98, either the original 16-bit version (in MS-DOS mode) starts automatically, or a new 32-bit version (in Windows) runs. Therefore, no matter which version of the operating system is available, you must always run the xcopy command, not xcopy32, even if it is available. The first version will always use the most appropriate version.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.unansea.com. Theme powered by WordPress.