if
Perform conditional processing in batch scripts. More information: https://learn.microsoft.com/windows-server/administration/windows-commands/if.
- Execute the specified commands if the condition is true:
if ()
- Execute the specified commands if the condition is false:
if not ()
- Execute the first specified commands if the condition is true otherwise execute the second specified commands:
if () else ()
- Check whether
%errorlevel%is greater than or equal to the specified exit code:
if errorlevel ()
- Check whether two strings are equal:
if %% == ()
- Check whether two strings are equal without respecting letter case:
if /i %% == ()
- Check whether a file exist:
if exist ()
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
