Dim fso
Dim fld
Dim blnSubs
Dim strPath
Dim strExtOld
Dim strExtNew
'*****SETTINGS*****
blnSubs = True 'Set True to change files in subfolders as well,
'Set False to work in only root of the given path
strPath = "C:\Temp" 'Path to work in
strExtOld = ".jpg" 'Old extension
strExtNew = ".jpeg" 'New extension
'******************
Set fso = CreateObject("Scripting.FileSystemObject")
Set fld = fso.getfolder(strPath)
Call ChangeExt(blnSubs, strPath, strExtOld, strExtNew, fld)
Set fso = Nothing
Msgbox "Done!"
Sub ChangeExt(blnSubs, strPath, strExtOld, strExtNew, fld)
Dim subfld
Dim fil
If blnSubs Then
For Each subfld In fld.subfolders
Call ChangeExt(blnSubs, strPath, strExtOld, strExtNew, subfld)
Next
End If
For Each fil In fld.Files
If Right(fil.Name, len(strExtOld)) = strExtOld Then
fil.Name = Left(fil.Name, Len(fil.Name) - len(strExtOld)) & strExtNew
End If
Next
End Sub