I guess I don’t understand how the Windows Command Prompt evaluates equality. I have a batch that looks like this:
@echo off
set test=12
if (%test% EQU 12) echo true
pause
This, strangely, does not print true. Could anybody tell me why this is?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Remove parentheses and it will work:
IF doesn’t use parentheses in conditions, just run
if /?and you will get information on it’s syntax.