Rename file to name Folder it is in

How do i rename a file to the name of the Folder it in without changing it's extension.

If i have have 10 directory's all with files in it how do i rename all the files in the 10 directory's at the same time to the folder names as the folder the are in, without the extension of the file changes.

The question has most probrably been asked and answerd. But i could not find the answer, please guide me on my way.

Select the folders containing the files you want to rename. (Note: This will rename all files below the folders, including in sub-directories, sub-sub-directories, and so on. Make sure that is what you want!)

Click the Rename button on the toolbar. If it opens in simple mode, click Advanced.

Turn on Enable file information fields. (Not needed if you are using the Opus 12 public beta, or a later version.)

Turn on Rename files in selected sub-folders.

Type should be set to Standard Rename.

Set the Old Name to *

Set the New Name to {parent}.{ext}

Use the Preview list to check what is about to happen before clicking OK.

You might want to do it on a test folder first, to avoid anything unexpected. Doing a backup of the folders is also a good idea before any recursive mass-rename.

Thx you very much for your answer. I am going to try this out.

This works very good for me except in a situation where there are multiple folders selected.

For example if you have two folders highlighted that look like this:

FOLDER1
FILE1.JPG
FOLDER2
FILE1.JPG

if you select folder 1 and folder 2 and run the command you get:

FOLDER1
FOLDER1.JPG
FOLDER2
FILE1.JPG

FILE1.JPG should be FOLDER2.JPG

Can this be fixed somehow?

Never mind i figured this out. I was mixing it with another part of my script. It works as advertised.

Opus 12's new rename dialog seems to do the right thing:


Using the "Ignore Extension" option we added also allows it to be done in a slightly cleaner way:


1 Like