BAT if% environment variable folder% exists (system folders)
2 answers
To check if an environment variable exists:
if defined VARIABLE echo Yep, it defined.
The following also works and prints the current value of the variable if set.
set VARIABLE && echo Found it! || echo Nope, sorry!
Note that SET also responds to prefixes, so if you have a var named VARIABLE then "set var" and "set v" will also return true.
Not the question you asked, but this is how I read the title, so someone else might have the same question.
+1
source to share