title: Batch: Rename multiple files using input string
body: <p>I am trying to rename files after the user inputs a string they want to remove from the file name. This works fine except when I want to rename files that are in a different location than the script:</p>
  
  <p>Here is what i have so far which works if I dont specific the file path (e.g. remove <code>C:\DATABASE\*.* /s</code>)</p>
  
  <pre><code>SET /P X=Type in the String that you want to remove and then press ENTER: 
  
  set deletestring=%X%
  for /f "delims==" %%F in ('dir C:\DATABASE\*.* /s /b ^| find "%deletestring%"') do (
      set oldfilename=%%F
      set newfilename=!oldfilename:%deletestring%=!
      Ren "!oldfilename!" "!newfilename!"
      )
  </code></pre>
  
  <p>Thanks!</p>