Check if a string variable is empty in batch script
<p>I am trying to write a batch script to get a string in a variable and check if it is empty, and if it is empty then it is directed to a loop. The below code represents the problem</p>

<pre><code>:loop
set /p cide=
IF NOT "a%1"=="a" (set cide="%1")
IF [%1]==[] goto loop
ELSE
echo IDE entered
TIMEOUT 5 &gt; NUL
</code></pre>

<p>The program starts to loop again even if i give a string.</p>

<p>I tried to put <code>IF [%cide%]==[] goto loop</code> or <code>IF %cide%==[] goto loop</code> it gave an error stating "ELSE" not recognized.</p>

<p>Any help is appreciated. Thanks</p>