I need to use a cmd.exe command line (cmd.exe is being called from the gyp build tool) to determine whether an environment variable is defined or not. How can I do this? I
OK, this took a bit, but I think I've figured it out. Try this:
SET UNDEFINED 2>Nul | Findstr/I "." IF ERRORLEVEL 1 ECHO Not Defined.
This works for all cases AFAIK, and does not rely on any command extension features.