title: How to replace string inside a bat file with command line parameter string
body: <p>I have following in a cmd batch file:</p>
  
  <pre><code>for /f %%l in (%2) do (for %%f in (%%l) do copy "%%f" %1))
  </code></pre>
  
  <p>note : this script basically does is read a text file that contains semicolon delimited txt file whose path is given by %2(eg which contains c:\test1\file1.cs;d:\file2.js) and copy the files to destination folder specified by %1.</p>
  
  <p>I need to replace the <code>%1</code> parameter's string value of <code>x</code> (which is also passed to batch file e.g. <code>%3</code>) with <code>%4</code> value which is also passed as parameter to batch file.</p>
  
  <p>e.g.: </p>
  
  <pre><code>if %1 = 'test replace x with y'
  %3=x
  %4=y
  </code></pre>
  
  <p>so the output should be 'test replace y with y'</p>
  
  <p>How can I achieve this using Windows CMD batch interpreter?</p>