title: Switch statement equivalent in Windows batch file
body: <p>I wonder if there is a simple way to branch execution in a Windows batch file depending on the value of one single expression. Something akin to switch/case blocks in C, C++, C#, Java, JavaScript, PHP, and other real programming languages.</p>
  
  <p>My only workaround is a plain if/else block where the same expression is repeatedly checked for equality against different values:</p>
  
  <pre><code>IF "%ID%"=="0" (
    REM do something
  ) ELSE IF "%ID%"=="1" (
    REM do something else
  ) ELSE IF "%ID%"=="2" (
    REM do another thing
  ) ELSE (
    REM default case...
  )
  </code></pre>
  
  <p>So dumb. Is there a better solution?</p>