Rename script and folder

i write and use this script to rename files but how modify it to rename folder too ?
Insérer à la position.orp (1.18 KB)

You want a if check around line: 24
like so:

If (fIsFolder = False) Then
Ext = Right (strFileName, Len(strFileName) - (InStrRev(strFileName, ".") - 1))
End If

Otherwise the script fails on folders.