title: replace text with userinput text, multiple lines
body: <p>I have a bit of code I am writing in a batch file, I already have it set so that you drag and drop the text onto the batch file and it adds in a header to the top of the .TXT document using a doctument called &quot;Header.txt&quot; shown below</p>
  <pre><code>Date: _DATE_
  Time: _TIME_
  Job ID: _ID_
  Plant: _PLANT_
  Code: _CODE_
  Program: _PROGRAM_
  Hand: _HAND_
  Group: _GROUP_
  
  LABEL                                 X-POS      Y-POS       Z-POS     X-CHK      Y-CHK     Z-CHK                                           I         J          K         +TOL       -TOL
  ===========================================================================================================================================================================================
  </code></pre>
  <p>how do I go about replacing text within the document? sofar below is my attempt:</p>
  <pre><code>@if not &quot;%~1&quot; == &quot;&quot; copy /B &quot;C:\Users\dougj\Desktop\New folder\HEADER.TXT&quot;+&quot;%~1&quot; &quot;%~1.tmp&quot; &gt;nul &amp; move /Y &quot;%~1.tmp&quot; &quot;%~1&quot;
  GOTO  :USERINPUT
  CLS
  
  :USERINPUT
  COLOR 7C 
  
      
      SET /p _INPUTNAME= Please Input DATE:
      
      
      FOR /F &quot;delims=&quot; %%G IN (
          'FORFILES /P &quot;%~1&quot; /C &quot;cmd /c echo @path&quot;'
      ) DO (
      for /f &quot;delims=&quot; %%H in ('type &quot;%%~G&quot; ^&amp; break ^&gt; &quot;%%~G&quot; ') do (
          set &quot;line=%%H&quot;
          setlocal enabledelayedexpansion
          &gt;&gt;&quot;%%~G&quot; echo(!line:_DATE_=%_INPUTNAME%
          endlocal
  )
  )
  pause
  cls
  
  
  GOTO :Finish
  
  :Finish
  CLS
  COLOR E3
  Echo.
  Echo.
  ECHO              FINISHED!
  Echo       Press any key to exit...
  Echo.
  Echo.
  
  Pause
  CLS
  EXIT
  </code></pre>
  <p>I ran the code and it gives me an ERROR: &quot;The specified directory does not exist.</p>