title: How can I check if an argument is defined when starting/calling a batch file?
body: <p>I'm trying to use the following validation logic in a batch file but the "usage" block never executes even when no parameter is supplied to the batch file.</p>
  
  <pre><code>if ("%1"=="") goto usage
  
  @echo This should not execute
  
  @echo Done.
  goto :eof
  
  :usage
  @echo Usage: %0 &lt;EnvironmentName&gt;
  exit 1
  </code></pre>
  
  <p>What am I doing wrong?</p>