title: Batch rename folders to files
body: <p>I have a parent folder with lots of folders (movies) underneath. Each folder has 1 file (the actual movie).</p>
  
  <p>I would like some advice on a batch script that I can run to rename the folders to the file (movie) within excluding the extension (.avi)</p>
  
  <p>e.g.</p>
  
  <p>BEFORE</p>
  
  <pre><code>Parent (folder)
    Folder 1
      Movie 1.avi
  
    Folder 2
      Movie 2.avi
  </code></pre>
  
  <p>AFTER</p>
  
  <pre><code>Parent (folder)
    Movie 1
      Movie 1.avi
  
    Movie 2
      Movie 2.avi
  </code></pre>