if

배치 스크립트에서 조건부 처리를 수행합니다. 더 많은 정보: https://learn.microsoft.com/windows-server/administration/windows-commands/if.

if {{조건}} ({{echo 조건 is true}})

if not {{조건}} ({{echo 조건 is true}})

if {{조건}} ({{echo 조건 is true}}) else ({{echo 조건 is false}})

if errorlevel {{2}} ({{echo 조건 is true}})

if %{{변수}}% == {{문자열}} ({{echo 조건 is true}})

if /i %{{변수}}% == {{문자열}} ({{echo 조건 is true}})

if exist {{경로\대상\파일}} ({{echo 조건 is true}})