Batch Logic


If

IF "%foo%"=="bar" ECHO Equal


Conditional Commands

To execute a command conditionally after another command, try:

del example.txt && echo "This only executes because the first command set an exit code of 0"

del example.txt || echo "This only executes because the first command set an exit code of 1"

These operators have equal precedence.


CategoryRicottone