Max Hallam
Max Hallam

Reputation: 85

Batch file If statement - syntax error?

I'm making a small batch file to look up the French perfect tense verbs that take etre, which comes from a text file. The whole file works, except this segment:

echo Type Q and hit enter to quit, enter any other key to try another verb.
set /p option=Enter Option:
IF %option%==Q(
  goto :quit
) else (
  goto :1
)

Typing Q and entering it works fine, but anything else comes up with the error 'incorrect syntax'. I can't see what's incorrect here, can anyone help?

Upvotes: 2

Views: 3992

Answers (1)

AjV Jsy
AjV Jsy

Reputation: 6075

Just add a space.
IF %option%==Q (

Upvotes: 3

Related Questions