An example:

if exist file.txt (
  echo The file exists.
) else (
  echo The file does not exist.
)

See also IF