title: How do you check if environment variables are defined in windows batch scripting
body: <p>I am trying to create a batch file to check if the environment variables are defined or undefined and gives a certain output statement if it is or not. This is what I have and I can't seem to get the program to tell me that any argument is defined.</p>
  
  <pre><code>if not defined "%MyVar%" (
      echo MyVar is NOT defined
  )
  
  if defined "%MyVar%" (
      echo MyVar IS defined 
  )
  </code></pre>