SoFunction
Updated on 2025-04-13

13. The security settings for xcopy under WIN2000 can copy files


13. The security settings for xcopy under WIN2000 can copy files

   
Under nt4.0, if the file is copied elsewhere, the acl of the file will be lost. You must use the program in the resource kit. The xcopy program under WIN2000 has several more parameters than nt4.0, and you can copy the file's security settings.

Xcopy Copy files and directories, including subdirectories.

xcopy source [destination] [/w] [/p] [/c] [/v] [/q] [/f] [/l] [/d[:date]] [/u] [/i] [/s [/e]] [/t] [/k] [/r] [/h] [/a|/m] [/n] [/exclude:filename] [/y | /-y] [/z] 

Parameters

source 

Specifies the location and name of the file to be copied. This parameter must contain a drive or path.

destination 

Specifies the destination of the file to be copied. This parameter can contain a drive letter and a colon, a directory name, a file name, or a combination.

/w 

The following message will be displayed and your response will be waited for: Press any key to begin copying file(s)

/p Copyright

Prompt you to confirm whether you want to create each target file.

/c 

Ignore errors.

/v 

Verify each file when writing to the target file to make sure the target file is exactly the same as the source file. Because this function is inherent to the Windows 2000 operating system, this switch will be ignored. The switch is accepted only for compatibility with previous versions of MS-DOS.

/q

Disable the display of xcopy messages.

/f 

The source file name and the target file name are displayed when copying.

/l 

Do not copy files, only the files to be copied are displayed (listed).

/d[:date] 

Copy only those source files that have been changed after the specified date or after the specified date. If the date value is lost, xcopy will copy all source files that are newer than the existing destination file. This option allows you to update only the changed files. If a date is specified, use a hyphen (-) as the delimiter instead of a forward slash (/) so that the date is not interpreted as another parameter.

/u 

Only copy (update) existing files in destination from source.

/i 

If source is a directory or contains wildcards and does not exist destination, xcopy will assume destination specified directory name and create a new directory, and then copy all specified files into the new directory. By default, xcopy will prompt you to specify whether destination is a file or a directory.

/s 

Copy non-empty directories and subdirectories. If this switch is omitted, xcopy will work in a directory.

/e 

Copy all subdirectories, including empty directories. Use with  /s  and  /t  switches.

/t 

Only the subdirectory structure (tree) is copied, but not the files are copied. To copy an empty directory, you must include the /e switch.

/k 

Copy the file, if the source file has a read-only property, it is retained in the target file. By default, read-only attributes are removed.

/r 

Skip read-only files when copying.

/h 

Copy files with hidden and system file properties. The xcopy command does not copy hidden files or system files by default.

/a 

Copy only those source files that have archive file attribute settings. This switch does not modify the archive file properties of the source file. For information on how to set archive file attributes, check the attrib command.

/m 

Copy the source file with the archive file attribute settings. Unlike the /a switch, the /m switch turns off the archive file properties of the file specified in the source. For information on how to set the properties of the archive file, click attrib in the "Related Topics" list [JG1].

/n 

Copy using NTFS short file or directory name. This switch is required when copying a file or path from an NTFS volume to a FAT volume or when the target volume requires the FAT file system naming convention (8.3). The target file system can be FAT or NTFS.

/exclude:filename 

Excludes copying operations on files listed in the specified file. Excluded files can have an excluded style list (one per line, no wildcards are supported). If an exclusion style in the file matches any part of the theme file path, the file will not be copied.

/y 

It is prohibited to prompt you to confirm that you want to overwrite the existing target file.

/y 

The switch can be preset in the COPYCMD environment variable. This switch can be replaced by  /-y  on the command line. The default is to prompt when overriding, unless the copy command is executed from inside the batch script.

To attach a file, specify a single target file, multiple source files (using wildcards or file 1 + file 2 + file 3 format).

/-y 

Prompt you to confirm whether you want to replace the existing target file.

/z Copyright

Copy over the network in restartable mode. If the connection is lost during the replication phase (for example, if the server disconnects offline), replication will continue after the connection is re-established. Using this command switch also displays the percentage of copy operations completed by each file.