title: Batch Script_ Compare Two String variables
body: <p>I am trying to compare one variable from user input("yes")
  , and predefined("yes") values. However, when I run the .bat file the cmd give me the syntax error message. Please help me how to compare two string values in if statement. thank you.   </p>
  
  <p>Here is Code:</p>
  
  <pre><code>@echo off
  goto main
  
  :main
  setlocal
  
  set ans=yes
  set /p var=do you have problem?:
  echo %var%
  
  if "%var%" == "%ans%"(
      echo there is problem
  )
  echo.
  
  endlocal
  goto :eof
  </code></pre>
  
  <p>Output:
      The syntax of the command is incorrect.</p>