Bulk deployment simple script under Windows

Source: Internet
Author: User

Under the Windows Deployment project is mainly to copy or paste, the following bat script is to use the system's own xcopy command to complete the copy and paste deployment.

1. What is XCOPY

        X Copy is a copy extension that allows you to copy the specified directory Sheung and directory structure but cannot copy system files; use at least one of the source drive characters, source target path name, source file name, and select/s to copy all files under the source directory and its subdirectories. Unless you specify the/e parameter,/s does not copy an empty directory, and if you do not specify the/s parameter, xcopy copies only the files of the source directory itself, not the subdirectories below it, and when you choose the/v parameter, the sector

2. Script Content

=======================================================================================

@echo off

:: Environment variables

Set datapath=e:\ tools \ Automatic Deployment \20170413

:: Copying files

Start cmd/k "xcopy%datapath% e:\apache-tomcat-7.0.47\webapps/e/s/y"

Start cmd/k "xcopy%datapath% f:\/e/s/y"

Start cmd/k "xcopy%datapath% g:\/e/s/y"

Start cmd/k "xcopy%datapath% h:\/e/s/y"

Start cmd/k "xcopy%datapath% i:\/e/s/y"

Start cmd/k "xcopy%datapath% j:\/e/s/y"

Start cmd/k "xcopy%datapath% k:\/e/s/y"

Start cmd/k "xcopy%datapath% l:\/e/s/y"

Start cmd/k "xcopy%datapath% m:\/e/s/y"

Start cmd/k "xcopy%datapath% n:\/e/s/y"

Start cmd/k "xcopy%datapath% o:\/e/s/y"

Start cmd/k "xcopy%datapath% p:\/e/s/y"

Quit

========================================================================================
3. Script interpretation

DataPath set to the file directory you need to deploy

xcopy Related parameter explanation:

/E Copy directories and subdirectories, including empty.

Same as/s/e. Can be used to modify/T.

/S Copy directories and subdirectories, except empty.

/y Copy file audit settings (implied/O).
The existing target file.
"is directly covered--three~ note"
4. Setup Steps

(1) Map the cost of disk to the folder that the remote server needs to deploy.

Computer right-==> mapped network drive ==> Select the drive letter you want to map to local ==> Select the corresponding remote folder

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/91/11/wKioL1j0HNOTrX3IAAAuJQYvc74629.png-wh_500x0-wm_ 3-wmp_4-s_3206280996.png "title=" Qq20170417093518.png "alt=" Wkiol1j0hnotrx3iaaaujqyvc74629.png-wh_50 "/>

(2) Create a bat file called Automatic deployment, and then paste the contents of the script in to save.

5. How to use

Place the files and bat files that you need to deploy in a folder called Automatic deployment, and then modify the script content by double-clicking perform automatic deployment. bat.

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/91/11/wKioL1j0HSvCLOXKAAA_8G3Hhyk519.png-wh_500x0-wm_ 3-wmp_4-s_3791431104.png "title=" Qq20170417094121.png "alt=" Wkiol1j0hsvcloxkaaa_8g3hhyk519.png-wh_50 "/>

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/91/12/wKiom1j0HO6Rbr3bAABqjz-uWvk191.png-wh_500x0-wm_ 3-wmp_4-s_3117672953.png "title=" Qq20170417093942.png "alt=" Wkiom1j0ho6rbr3baabqjz-uwvk191.png-wh_50 "/>






This article comes from "Endless dreams!" "Blog, be sure to keep this provenance http://quguoliang2013.blog.51cto.com/6321414/1916550

Bulk deployment simple script under Windows

Related Article

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.