title: Batchfile: What's the best way to declare and use a boolean variable?
body: <p>What's the best way to declare and use a boolean variable in Batch files? This is what I'm doing now:</p>
  
  <pre><code>set "condition=true"
  
  :: Some code that may change the condition
  
  if %condition% == true (
      :: Some work
  )
  </code></pre>
  
  <p>Is there a better, more "formal" way to do this? (e.g. In Bash you can just do <code>if $condition</code> since <code>true</code> and <code>false</code> are commands of their own.)</p>