title: Batch to rename files using substring in filename
body: <p>If possible, I am hoping to create a batch file that can go through a folder filled with seemingly random filenames and rename them using a substring that exists within each filename. The naming convention seems pretty random but within each file name exists an "a" followed by 2 digits then a "b" followed by 2 digits (a##b##). None of the values would match so you need not worry about resulting filenames conflicting with each other. </p>
  
  <pre><code>before:
  left.process.a11b22.Feb.11
  maid island a22b33 Mar 12
  charm.dinner.a12b34.Jun.13
  motivation blame a00b00 Nov 14
  laser.activate.a99b99.Oct.15
  </code></pre>
  
  <p>I would just like these renamed to something more manageable for consistency while retaining the relevant values. Ideally, renaming them to the folder's name followed by the substring.</p>
  
  <pre><code>Ideal result:
  Folder Name a00b00
  Folder Name a11b22
  Folder Name a12b34
  Folder Name a22b33
  Folder Name a99b99
  </code></pre>
  
  <p>This is asking a lot already and this isn't as important but if it could be done recursively that would save an extra step. Maybe even ignoring any file that doesn't have the substring in its name. However I've never managed to come across a batch that could recursively rename taking each individual Folder Name into account. Anyway, thanks in advance. </p>