title: Why does my if Else if statement not work in Batch script?
body: <p>My Script</p>
  
  <pre><code>echo "Enter your choice (1 or 2 or 3) :"
  set /p dbchoice=
  
  IF %dbchoice EQU 1 ( 
      set dbtype="oracle"
  ) ELSE ( 
      IF %dbchoice EQU 2 ( 
          set dbtype="sqlserver" 
      )
  ) ELSE ( 
      IF %dbchoice EQU 3 ( 
          set dbtype="db2" 
      )
  ) ELSE (
      echo "Incorrect choice" 
  )
  </code></pre>
  
  <p>I get the following output:</p>
  
  <pre><code>E:\csmilm&gt;set /p dbchoice=
  1
  ELSE was unexpected at this time.
  E:\csmilm&gt;) ELSE (
  E:\csmilm&gt;
  </code></pre>
  
  <p>What is the problem here?</p>