You need to make sure that both sides are the same BUT you can't check a blank, i.e. if %2 is blank then it becomes
if =="" then etc. which isn't legal (nothing on LHS) or equal.
I tend to wrap both sides in quotes:
if "%2"=="" then goto :help
exit /b
:help
echo You need to use
echo %0 thing1 thing2
exit /b
Steve
Main Topics
Browse All Topics





by: NetExpert-WarszawaPosted on 2009-09-04 at 01:15:01ID: 25257587
IF X%2% == X THEN ...
You can also try (Command Extensions required)
IF DEFINED variable