title: Set static variable if condition equals true with batch file
body: <p>I'm trying to give the user an option to either use a default directory, or use their own directory as the variable <code>%1</code>. Here is what I have:</p>
  
  <pre><code>if ("%1"=="default") {set %1=C:\TestExecution\test}
  set source=%1
  IF NOT EXIST "%source%" goto error3
  
  goto end
  :error3
  echo.
  echo Error: Invalid Path
  echo %source%
  goto end
  :end
  </code></pre>
  
  <p>When trying to test it out using cmd, here is the results:</p>
  
  <pre><code>c:\TestExecution&gt;test.bat default 10.42.232.245
  
  Error: Invalid Path
  default
  </code></pre>
  
  <p>If anyone knows the right syntax for this and could help a person new to this, it would be much appreciated.</p>