3

How to Rename Part of a File Name from a Selection of Files in Windows?

I know about the Windows trick where you just select a group of files and upon renaming it will add a sequential number to make them all unique.

However I'm looking for a way to rename a selection of files using a search and replace or Regular Expression.

For example starting with:

  • Menu1_Off.jpg
  • Menu1_On.jpg
  • Menu2_Off.jpg
  • Menu2_On.jpg

I would like to change Menu1 to Home like:

  • Home_Off.jpg
  • Home_On.jpg

Or change the On to Hover like:

  • Menu1_Off.jpg
  • Menu1_Hover.jpg
  • Menu1_Off.jpg
  • Menu2_Hover.jpg
2

On Windows, I use the excellent (and free) ReNamer tool.

Screenshot below demonstrates how to do your example operation with 2 simple Replace rules, but you can also use Regular Expressions if you want.

enter image description here

4

This can be done with PowerShell quite easily. Here is an example for your first use case (single line):

Get-ChildItem 'Menu1*.jpg' | Rename-Item -NewName { $_.Name -Replace 'Menu1','Home' }

That should get you the gist of it.

1

If you are looking for a good file renaming solution for Windows I would definitely have a look at Bulk Rename Utility. It is quite powerful and for complex renaming rules definitely worth a try. It also supports regular expressions.

I have used it in the past and although the fronted seems to be a bit confusing it does the job really well.

1

If you want full control of the process it can be done using PowerShell, there's information on how to do this here. Alternatively the Regular Expression File Renaming Utility is useful for doing this.

1

If you want something user-friendly that also helps you with all other file-management tasks, including replacing the pretty worthless Windows Explorer, check out Directory Opus. Sure, it's not free, but for what you get and the possibilitiy to sort and quickly see directory sizes on file shares is excellent - I think it's worth it. Try the trial ^^ old Magellan on Amiga user

1

Better File Rename

0

StExtBar has an amazing rename utility. You can use regex patterns for renaming and compare the changed file name before applying rename.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.