I am learning Batch scripting and I copied example how to check for empty :
@echo off
SET a=
SET b=Hello
if [%a%]==[] echo "String A is empty"
if [%b%]==[] echo "String B is empty "
but I get such error:
D:\Projects\Temp\BatchLearning>Script.bat
]==[] was unexpected at this time.
what the problem? Why this was in guide. Did it work in past? Example from here.
UPD:
I deleted some whitespaces in the end of 2nd, 3rd and 5th(last) lines and everything works now as expected, what is going on?