Bat (batch file) preliminary first basic symbol

Source: Internet
Author: User

Recently I used a software that requires a lot of environment variable settings, and I do not want to say that these variables are added to the system environment variables, on the one hand, because some of the same name of the library file version number is different, written in the system environment will interfere with each other, and another aspect is that most of the path is only required in this software, It is therefore most appropriate to process with bat.

BAT file is a more frequently used file format in Windows, he also has a set of grammatical standards, the following is what I think learning bat need to understand, master these even if they can not write, at least others can read. This article first tells the basic symbol, because I most start to look at bat when it is because of these symbols to feel it is very magical.

1, @ symbol

This symbol does not have a special meaning, generally used for a row of the beginning of the position is only to make the row execution when not displayed on the command line

@ECHO on/OFF: The switch that corresponds to whether to output commands on the command line

2,% symbol

This symbol is generally used in pairs, in the middle of the variable name, such as:%sam%, equivalent to a variable, commonly used to represent a string

%i% (i is the parameter): used to denote command line parameters, such as: Test.bat ' abc ' BCD ';

Also like this:%~dp0, this is a special expression that refers to the current path


3, REM

This symbol represents the meaning of the gaze, which is equivalent to//in the C language, able to gaze at a line


Bat (batch file) preliminary first basic symbol

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.