title: DOS echo %variable% "Echo is ON"
body: <p>I have a dos batch file.</p>
  
  <pre><code>mycommand.exe&gt;c:\temp
  find /B Serv c:\temp&gt;c:\temp2
  set /p var1=&lt;c:\temp2
  SET var2=%var1:~-7%
  echo %var2%
  </code></pre>
  
  <p><strong>This is only DOS, not windows environment.</strong></p>
  
  <p>The problem is that, the batch file output is:
  "Echo is ON". Can't echo the VAR2 variable.</p>
  
  <p>mycommand.exe is a simple app. Not important. </p>
  
  <pre><code>&gt; type c:\temp"
  VERSION 45.2
  TAG1 NUMBER is 1234567
  Serv NUMBER is 9654754
  
  &gt; type c:\temp2
  c:temp Serv NUMBER is 9654754
  </code></pre>
  
  <p>What can I do, If I would like echo the VAR2 variable?
  I can't use "setlocal enabledelayedexpansion" because setlocal "Command or filename not recognized". </p>
  
  <p>Edit: What am I want exactly?
  I would like to ECHO mycommand.exe output 3rd line last 7 characthers. Thats all.</p>