DEFINED is a comparison operator for the IF command

      IF [NOT] DEFINED variable command

IF DEFINED will return true if the variable contains any value, even if the value is just a space.


Check if the variable %_demo% exists:

C:\> if defined _demo echo Variable found!

“Confidence comes not from always being right but from not fearing to be wrong” ~ Peter T. Mcintyre

Related commands

IF command

Copyright © 1999-2024
Some rights reserved