Conditionally executes a command. Available elementary tests:

To each elementary test, "not" can be applied. Apparently there are no operators like AND, OR, etc. to combine elementary tests.

The /I switch makes the == and equ comparisons ignore case.

An example:

if not exist %targetpath% (
  echo Target path not found.
  exit /b
)

Examples: