Website file Update Tool

Source: Internet
Author: User

When updating a website, there are usually not many files updated, but the files are in different directories. In this way, it is troublesome to back up the original file and update the file. If there are 7 front-end machines, it is really annoying. Therefore, this tool is available.

In fact, the xcopy command has been implemented. We only need to make good use of it. That is, copy the file to be updated to the backup directory, and then copy the files in the backup directory from the target directory. Copy the new file.

 

 

Code
@ Echo   Off
Echo **************************************** ************
Echo * ** Version: V1 . 1 ***
Echo * ** Function: Copy all files in the specified directory to the specified directory ***
Echo * ** Back up existing files to the backup directory ***
Echo *** Written by: Niu kunliang, Hebei quantong Software Center 2009 - 2.19 ***
Echo **************************************** ************
If   " % 1 " = ""   Goto Input
If   " % 2 " = ""   Goto Input
Set SRC = % 1
Set Des = % 2
: Begin
If   " % SRC % " = ""   Goto Usage
If   " % Des % " = ""   Goto Usage
Echo   ========================================================== ========
Echo Upgrade to be executed
Echo New file path: % SRC %
Echo Original file path: % des %
Set   / P gotoend = " Press Y to continue. Other exits: "
If   Not   " % Gotoend % "   =   " Y "   Goto   End
Set Bakpath = Bak _ % Date :~ 0 , 10 % Time :~ 0 , 2 % Time :~ 3 , 2 % Time :~ 6 , 2 %
Xcopy   " % SRC % \*.* " % Bakpath % \   / S
Xcopy   " % Des % \*.* " % Bakpath % \   / S / U / R / Y
Xcopy   " % SRC % \*.* "   " % Des % \ "   / S / R

Goto End

: Input
Set   / P SRC = Enter the path name of the new file. ( Example: srcpath ):
Set   / P des = Enter the path name of the original file (for example, despath ):
Goto Begin
: Usage
Echo Usage : Update Srcpath despath
: End
Echo Press any key Exit
Pause

 

[Url href = "http://files.cnblogs.com/evlon/update-tool.rar" ]update-tool.rar [/url]

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.