title: How to rename files in folders to foldername using batch file
body: <p><br>
  Could any of you help me with a problem I have with a lot of files with the same name, placed in sperate folders.<br>
  The folders are named with numbers, but the files inside are named index.XXXX - where XXXX could be .jpg or .html or .pdf.<br>
  I would like to make a 'program' that can rename all the 'index' files to the same name as the folder they are placed in.<br>
  The folders are named with 6 digit numbers - all different.<br>
  After this hopefully has been done, then I would like to move all the renamed files to a new single folder, so it will be easier for me to see the whole content.<br>Looking forward to reading your answers. </p>