Script command line basic learning notes (1)

Source: Internet
Author: User
This article is original by the owner Ms

1. CLs clear screen

2. Rem comments

3. Echo: Display messages and echo

4. @ echo method of the single-digit control command at the end of a line

5. Title: Set the title bar of the shell window.

6. color settings command shell window text color and background color the first digit represents the background color the second digit represents the file color

7. Some characters are reserved for the command line, including the characters such as @, ',', &, |, and ^. When using these characters, you must use the transcoding character ^ to convert them.

For example, 2 & 3 = 5 should be 2 ^ & = 5

Some strange phenomena may occur when the variable values in this example are displayed. For example, if you see different equations or get error information, if you want to set the variable value to contain special characters, at the same time, you can display this value to the user. Three transcoding characters must be used ^;

8.
If "% errorlevel %" = "2" Echo "An error occurred! "Quotation marks indicate the comparison of string values.

9. All mathematical expressions are for 32-bit signed certificates. The value ranges from-2 to 32-power + 1.

10. Operator priority in the expression: 1. modulus operation 2. multiplication and division operation 3. addition and subtraction operation.

11. strings are case-sensitive. Unless the/I parameter is specified, subtitles are case-insensitive.

12. The iterator variable name is case sensitive.

13. Use sub-accountsProgramAnd process. The subroutine uses the GOTO statement or label to jump to and use the process. If the call statement is not used, other script names are referenced in the metascript, the shell command executes the referenced script, but the control is not returned to the caller after the script is executed.

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.