Try this button-code:
Rename to="{parent}.{ext}" FILEINFO
Found it here: [Renaming on basis of folder name)