-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