title: If statement in Windows Batch file
body: <p>I have been stuck on this silly if statement, whatever i do, I cannot get the if statment to go to the correct label. </p>
  
  <ol>
  <li>Hitting 'y' works, cmd-prompt stops at START DEPLOY</li>
  <li>BUT, if I type 'n' cmd prints START DEPLOY then goes to end, instead of going direct to the cancel label. </li>
  </ol>
  
  <p>Can you help?</p>
  
  <pre><code>:getConfirmation
  set /p confirmDeploy =Confirm deployment of code [y/n] ?: 
  if "%confirmDeploy%"=="y". goto deployCode
  if "%confirmDeploy%"=="n". goto cancelDeploy
  
  :deployCode
  ECHO START DEPLOY
  goto end
  
  :cancelDeploy
  ECHO DEPLOY CANCELLED
  goto end
  </code></pre>