1
votes

would anyone know how to write a batch file (or two) that would: copy hundreds of "index.html" files that are in different folders and keep within the same folder (so needs to search within sub folders) rename the copies (keep the originals as is) to "index.jpg"

could anyone help?

1
could you please given an example of the Directory Structure? Is it something like this : (Directory1 -> index.html , Directory2 ) | (Directory2 -> index.html) If so, what should be the final result ?Ashutosh Jindal
upload_files\P1030582.jpg\width\500\index.html - the "upload_files" is the main directory, but after that there's folders with varying names, no structure to them. I'm wanting to keep the new copies in the same folder as the originals.Maff
So, for example you would have possibly the following : upload_files\DirectoryA\index.html and upload_files\DirectoryB\index.html and as the final result you would want the two index.html files to be copied as upload_files\INDEX-HTMLS\index1.html and upload_files\INDEX-HTMLS\index2.html ?Ashutosh Jindal
start with upload_files\abcd123\index.html and upload_files\987fgh\index.html - after I would want: upload_files\abcd123\index.html then within the same folder index.jpg and upload_files\987fgh\index.html and within the same folder index.jpg - basically, I want all the index.html files kept in their current folders and the copies which are renamed to index.jpg in the same folder as the file they are copied fromMaff

1 Answers

0
votes

I used a bulk rename tool to rename all index.html files to index.jpg in a copy of the main folder, then used robocopy to copy everything over, including the file structure back to the original folder (leaving the index.html's alone)