To establish a folder method named after the current date

Source: Internet
Author: User
Tags robocopy

1, view the system "Region and Language" format

2, press "Additional settings" to view the time format and date format in the Customize format as follows:

3, after checking the format, in the cmd command line, enter date, displayed as follows:

4, below we in the C packing directory to create a batch file Test01.bat, the code is as follows:

5, C disk directory to create a Test01.bat file

6, double-click to run this bat file can see in the C-packing directory created a 20130110 folder

7. Why do you want to create a folder with the name of the current date? Because some companies need to back up the server's data every day, especially the file server, so we can create batch commands, set up some schedule to make the system run automatically every day, and easy to view, manage, and recover. We want to distribute by date, so just add the Robocopy command to the Test01.bat command above, and copy it to the folder you just created. In this, robocopy of the use of features do not need me to introduce more, in the command line mode, enter: Robocopy/? To see how the command is used, the options we use are these:

Usage:: ROBOCOPY source destination [file [file] ...] [Options]

Source:: Source directory (drive: path or server share path).

Goal:: Target directory (drive: path or server share path).

Files:: Files to copy (name/wildcard: default is "*.*").

/S:: Replicates subdirectories, but does not copy empty subdirectories.

/e:: Replicates subdirectories, including empty subdirectories.

/sec:: Copy the file with security (equivalent to/copy:dats).

/copyall:: Copy all file information (equivalent to/copy:datsou).

/mov:: Move the file (removed from the source after copying).

/move:: Moving files and directories (removed from the source after replication)

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.