Batch: Why does appending a textfile write "ECHO is off" instead?
<p>So I wrote a batch that has some code to check how many times it has been run by reading a textfile and then writing back into that textfile the new, increased number.</p>

<pre><code>@ECHO OFF
for /f "delims=" %%x in (TimesRun.txt) do set Build=%%x
set Build=%Build%+1
@echo Build value : %Build%
echo %Build%&gt;&gt;TimesRun.txt
Pause
</code></pre>

<p>That does append the textfile allright, but it adds "1+1" to it. Silly me! I forgot to use the /a switch to enable arithmetic operations! But when I change the code accordingly...</p>

<pre><code>@ECHO OFF
for /f "delims=" %%x in (TimesRun.txt) do set Build=%%x
set /a Build=%Build%+1
@echo Build value : %Build%
echo %Build%&gt;&gt;TimesRun.txt
Pause
</code></pre>

<p>... something funny happens: Instead of appending my file, <em>ECHO is off.</em> gets written on the console. Now, I know that this usually happens when <code>ECHO</code> is used without text or with an empty variable. I have added the first <code>@echo Build value : %Build%</code> specifically to see whether the variable <em>Build</em> is empty or not; it is not, and the calculation was carried out correctly. 
I already figured out that </p>

<pre><code>&gt;&gt;TimesRun.txt (echo %Build%)
</code></pre>

<p>does bring the desired result. I still do not understand why </p>

<pre><code>echo %Build%&gt;&gt;TimesRun.txt
</code></pre>

<p>does not, however. What am I missing?</p>