开发者

dos batch : using double quotes with IF

I have a DOS-batch like this :

@echo off
if "%开发者_JAVA技巧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 ?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜