views:

13

answers:

1

I have a DOS-batch like this :

@echo off
if "%1" == "%2" GOTO next
echo different
goto end
:next
echo same
:end

Are the double quotes surrounding %1 and %2 necessary ? In which case are they useful ?

+1  A: 

You need an expression before and one after the ==. If %1 or %2 is empty than you would get an syntax error.

harper