Use of xcopy command

Source: Internet
Author: User

1. xcopy is used to copy files and folders under DOS. The specific format is as follows:

 

Xcopy source [destination] [/A |/m] [/d [: date] [/P] [/s [/E] [/V] [/W]
[/C] [/I] [/q] [/F] [/L] [/h] [/R] [/T] [/u]
[/K] [/n] [/o] [/X] [/y] [/-y] [/Z]
[/Exclude: file1 [+ file2] [+ file3]...]

Source specifies the file to be copied.
Destination specifies the location and/or name of the new file.
/A only Copies files with an archived property set,
But does not change attributes.
/M only Copies files with an archive property set,
Disable the archive attribute.
/D: M-D-Y: copy the objects that have changed since the specified date or date.
If no date is provided, only the source time is copied.
A file that is newer than the target time.
/Exclude: file1 [+ file2] [+ file3]...
List of objects containing strings. If any
Absolute path of the string and the file to be copied
The file will not be copied.
For example, strings such as/obj/or. OBJ are excluded.
All files under the OBJ directory or
File with the. OBJ extension.
/P prompt before creating each target file.
/S copies directories and subdirectories, except empty.
/E: Copy directories and subdirectories, including empty ones.
Same as/S/e. It can be used to modify/t.
/V verify each new file.
/W prompts you to press the button before copying.
/C continues copying even if an error occurs.
/I if the target does not exist, copy more than one file,
It is assumed that the target must be a directory.
The file name is not displayed during/Q replication.
/F indicates the complete source and target file names.
/L displays the file to be copied.
/H also copies hidden and system files.
/R rewrite the read-only file.
/T create directory structure, but do not copy files. No
Including empty directories or subdirectories. /T/e Includes
Empty directories and subdirectories.
/U only Copies files that already exist in the target.
/K copy attributes. Generally, xcopy will reset the read-only attribute.
/N is copied with the generated short name.
/O copy the file ownership and ACL information.
/X copy file audit settings (implicit/O ).
/Y forbidden prompt to confirm rewriting of one
Existing target file.
/-Y causes a prompt to confirm rewriting of
Existing target file.
/Z copies network files in restart mode.

 

Syntax: the path of the xcopy target file and directory to be copied/s

For example, xcopy C:/Windows/*. * C:/temp/s
Copy all the files and folders under C:/Windows/to temp!

Xcopy is an external command. First, make sure that you have this command on your hard disk. If you have not set the directory where the command is located in the PATH environment variable, you must execute the command in the directory where the file is located!
For example, C:/DOS/xcopy C:/Windows/*. * C:/temp/s

 

Supplement: I encountered a problem today when I checked my colleagues' cameras. Virus in the memory card of a colleague. The specific phenomenon is that the folders in the memory card are hidden, but the folder shortcut is displayed, but the corresponding folder cannot be opened when you double-click the shortcut. So I used DIR/a to view the memory card under cmd. You can see the corresponding folder. Record the corresponding folder name. The simplest way to view the folder content is to open a window on my computer and enter it in the address bar. G:/dcim/directory. You can open the directory to view the contents in the directory.

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.