Q:

Error using IF statement in Batch Files (Windows)

I am trying to use IF statement in the below code. 
@echo off
SET a=
SET b=HELLO WORLD
echo %b%
if [%a%] == [] echo "String A is empty"
if [%b%] == [] echo "String B is empty" 

I am getting the output as below
HELLO WORLD
"String A is empty"
WORLD] was unexpected at this time. 

Why is WORLD] was unexpected at this time.  appearing in the output.  Can you please point out the error?  Thanks in advance. 

A:

@echo off
SET a=
SET b=HELLO WORLD
echo %b%
if "%a%" == "" echo "String A is empty"
if "%b%" == "" echo "String B is empty" 

This is because the space in %b% and is taken as two arguments to if. Quotes can be used to pass arguments with delimiters but not []

