DEFINED is a comparison operator for the IF command

Syntax
      IF [NOT] DEFINED variable command

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

Examples

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-2022 SS64.com
Some rights reserved