ERRORLEVEL and%errorlevel%

Source: Internet
Author: User

Their function is to judge the return value of the last command.

By default, the return value of one command is only 2, 0 indicates success, and 1 indicates failure.

But there are exceptions, some command return values will be greater than 2, the return value can be any number between 0~255

if ERRORLEVEL Echo Right

When the return value is >=0, the output right

if %errorlevelecho right2

When the return value is =0, the output right2

The If%errorllevel% comparison method does not only use the = = number, but can also be controlled using the following parameters:

EQU: Equals

NEQ: Not equal to

LEQ: Less than or equal to

LES: Less than

GTR: Greater Than

GEQ: greater than or equal to

ERRORLEVEL and%errorlevel%

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.