Batch Script_ Compare Two String variables -


i trying compare 1 variable user input("yes") , , predefined("yes") values. however, when run .bat file cmd give me syntax error message. please me how compare 2 string values in if statement. thank you.

here code:

@echo off goto main  :main setlocal  set ans=yes set /p var=do have problem?: echo %var%  if "%var%" == "%ans%"(     echo there problem ) echo.  endlocal goto :eof 

output: syntax of command incorrect.