For and set parameters learning notes

Source: Internet
Author: User

Batch tips,

  1. for/f parameter usage:
    1.1 "delims=*" equals the left and right spaces are meaningful.
    1.2 option's default parameter is "delims=", so the default parameter case, read a line of parameters encountered a space is not read. To finish reading the whole line, we can make the delims argument the last character.


  2. Summary of SET parameters:
    2.1 Set i= "ABC" assigns a string to I. Such as:
    Set i= "ABC"
    Echo%i%
    If%i%== "abc" (Echo equal to ABC) else (echo don t equal to ABC)

    2.2 set/a i=123 assigning numbers to I

    2.3 set/p i= Please enter a value for I, the default input is a number, if you want to use the string, I need to call the variable when I want to add "", such as:

    3.3 set/p I=please told me your options:

    Echo%i%

    If "%i%" = = "A" (Goto Addpatch) Else (goto Installpatch)

    : Addpatch
    echo Add patch
    Goto:eof

    : Installpatch
    echo Install patch
    Goto:eof

For and set parameters learning notes

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.