-1
我得到了这个疑问,请人解释概念批量脚本
@echo off
:: take any number between 1 to 1619 it is true
if ERRORLEVEL == 0 echo There was a problem with the command error returned %errorlevel%
echo 0
if ERRORLEVEL == 1 echo There was a problem with the command error returned %errorlevel%
echo 1
if ERRORLEVEL == 1619 echo There was a problem with the command error returned %errorlevel%
echo 1619
:: greater than 1619 false
if ERRORLEVEL == 1620 echo There was a problem with the command error returned %errorlevel%
echo 1620
if ERRORLEVEL == 658547 echo There was a problem with the command error returned %errorlevel%
echo 658547
:: any negative number true
if ERRORLEVEL == -1620 echo There was a problem with the command error returned %errorlevel%
echo -1620
if ERRORLEVEL == -63653 echo There was a problem with the command error returned %errorlevel%
echo -63653
为什么呢?任何背后的概念?
它要么'如果%ERRORLEVEL%== 5'(正是 “5”)或'如果ERRORLEVEL 5'( “5” 或更高版本)。当然'如果'也有“LSS”,“GTR”等等。参见'if /?' – Stephan