title: DOS batch - rename all files in subdirectories to have subdirectory name prefix
body: <p>I basically have a setup like this:</p>
  
  <pre><code>C:\Upload\A
  C:\Upload\B
  C:\Upload\C
  C:\Upload\D
  C:\Upload\E
  </code></pre>
  
  <p>Where <code>A</code>, <code>B</code>, <code>C</code>, <code>D</code>, <code>E</code> are always different (product IDs) and will always be a different amount (it won't always be 5 sub-directories). Each of these sub-directories contains 24 images numbered numerically 01-24.</p>
  
  <p>I need to create a batch file that looks at the Upload directory, gets the name of each sub-directory and appends that name to beginning of each image file contained within that sub-directory.</p>
  
  <p>So, <code>C:\Upload\A\01.jpg</code> would become <code>C:\Upload\A\A-O1.jpg</code> as well as the other 23 images in each sub-directory.  </p>
  
  <p>The batch file needs to do the same for every sub-directory within the Upload directory.</p>
  
  <p>This sounds extremely complicated to me and where I have started to try and write this, I don't yet have anything worth sharing in this post.</p>
  
  <p>Any help will be appreciated.</p>