Renaming a file into folder based on name and parent

I want to move selected folders to new created folders based on the name of the selected folders. The name of the new created folder is based on the first part of the folder which ends with a '_' or a ',' (without the quotes). The second part of the new folder name is based on the name of the parent folder.
New\Elton John_rest of the folder name should be moved to New\Elton John (New)

How have I to code this?


you might find some help in this thread: Rename files using their parent folder

The thread you mention was not the greatest problem to solve. I like to know how I create the first part.

You can do that using "RENAME FILEINFO" because RENAME can also create a Folder Structure.
The following command does exactly what you want, but it works only with the first selected Folder.
Deleting the "@firstfileonly" Modifier and using it selecting several Folders would move them all to a single Folder with Name based on the first selected Folder.

@dirsonly @firstfileonly Rename FILEINFO TO "{file|noext} - {parent}\*"

Thanks for you reply, I will have a look at your solution.