As Arc's link lacked the code to rename the files and I had already got the basics working I thought I would still post my script.
This poor script I wrote will rename the first file to folder.jpg in all subfolders in the folder it is placed. It will only do it alphabetically (A-Z) regardless of the file sorting you have set, eg. "A" would be renamed. It also does not check if the file is a .jpg but it does check if the file "folder.jpg" already exist.
Recommend testing on a several subfolders copied to a test folder first. If you want to run it from any location you can put a path and folder name in, just change the bolded text (".\"
) to your folders path for example, "C:\My Pictures".
There is also a small safety net in the script, it will ask to confirm you want to run it and require you to type the word "Yes" so you should not be able to accidently run it in the wrong location as is it works on all subfolders in the folder it is placed or all subfolders of the path you put in. You DO NOT want to run this on the wrong folder.
Copy the code to notepad and save as FILENAME.vbs then double click to run it. It will display a message when finished.
strConfirm = InputBox("Are you sure you want to proceed?" & Chr(13) & Chr(13) & "Enter Yes to proceed", _
If strConfirm = "Yes" Then
Set objFSO = CreateObject("Scripting.FileSystemObject")
objStartFolder = ".\"
For Each Subfolder in Folder.SubFolders
Set objFolder = objFSO.GetFolder(Subfolder.Path)
Set colFiles = objFolder.Files
If Not objFSO.FileExists(objFolder & "\" & "folder.jpg") Then
For Each objFile in colFiles
objFSO.MoveFile objFolder & "\" & objFile.Name, objFolder & "\" & "folder.jpg"