Folder backup in Windows

Source: Internet
Author: User

Problem:

We all know that in Linux, we can use the command CP-RF file renamefile to back up folders. How can we use it in windows?

Solution: Use the xcopy command

Write the following command into a file and save it as a file ended with. bat, for example, xcopy. bat.

Xcopy/I/y/E: \ ftpserver \ CPS-% Date :~ 0, 10%

Double-click xcopy. BAT and you will find that E: \ ftpserver has a file cps-2012-05-16 with a date command

Note:

Do not save this name as xcopy. bat, otherwise it will not stop refreshing, because the xcopy command will be used in the command, do not avoid it !!!

Case:

Xcopy/I/y/E c: \ bank \ data c: \ bank \ databack \ data-% Date :~ 0, 10%
Start c: \ bank \ ctbase.exe

Resolution:

Xcopy is an extension of copy. You can specify the DirectoryConnection file and directory structureCopy together, but do not copy the hidden and system files. specify at least one source drive letter, source target path name, and source file name when used; when/s is selected, all files in the source directory and Its subdirectories are copied. Unless the/e parameter is specified, the/s will not copy the empty directory. If the/S parameter is not specified, xcopy will only copy the files in the source directory, but will not involve the subdirectories under it; when the/V parameter is selected, the copied slice is verified, but the speed is reduced.

/I if the target does not exist and more than one file is being copied, it is assumed that the target must be a directory.

/Y cancel the prompt to confirm that you want to overwrite the existing target file.

/E: Copy directories and subdirectories, including empty ones.

For details about the xcopy command, refer to the following documents ~

Http://baike.baidu.com/view/893375.htm

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.