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

Batch/Logic (last edited 2023-01-30 03:11:37 by DominicRicottone)