title: How to concatenate strings in a Windows batch file?
body: <p>I have a directory for which I want to list all the <code>.doc</code> files with a <code>;</code>.</p>
  
  <p>I know the following batch command echos all the files:</p>
  
  <pre><code>for /r %%i In (*.doc) DO echo %%i
  </code></pre>
  
  <p>But now I want to put them all in a variable, add a <code>;</code> in between and echo them all at once.<br>
  How can I do that?</p>
  
  <pre><code>set myvar="the list: "
  for /r %%i In (*.doc) DO &lt;what?&gt;
  echo %myvar%
  </code></pre>