title: @echo off in cmd
body: <p>I'm trying to write a BAT script and I have the following:</p>
  
  <pre><code>@echo off
  REM Comments here
  SETLOCAL ENABLEDELAYEDEXPANSION
  set PROG_ROOT=C:\Prog
  set ONE=1
  
  echo 1&gt;&gt; %PROG_ROOT\test.txt
  echo %ONE%&gt;&gt; %PROG_ROOT\test.txt
  
  for /f "tokens=*" %%f in (folders.txt) do (
      echo %%f&gt;&gt; %PROG_ROOT\test.txt
  )
  
  ENDLOCAL
  </code></pre>
  
  <p>My folders.txt contains the number "5".</p>
  
  <p>My test.txt output is</p>
  
  <pre><code>ECHO is off
  ECHO is off
  5
  </code></pre>
  
  <p>I don't understand why the first 2 lines of output has "ECHO is off", while the third line is printed out correctly. How do I print the correct output?</p>
  
  <p>ETA: I tried</p>
  
  <pre><code>echo 1&gt;&gt; %PROG_ROOT\test.txt
  echo %ONE% &gt;&gt; %PROG_ROOT\test.txt
  </code></pre>
  
  <p>and I was able to print</p>
  
  <pre><code>ECHO is off
  1
  </code></pre>
  
  <p>However, I need to NOT print the trailing space after the number.</p>