How to batch rename files and folders in XYplorer

Being able to batch rename files and folders is a must have feature when we are working with larger quantities of files.

To batch rename files and folders in XYplorer, start by selecting what you want to rename in the list view, next press File>Rename Special. Here you will find all batch renaming options in XYplorer.

Let's dive deeper into all these options.

How to use the batch rename feature in XYplorer

When you go to File->Special rename you will be presented with a bunch of options. But let's start at the very bottom. Here you will see "Preview all". This allow us to get a popup with all the files and folders that we are trying to rename that shows us all the changes to each file or folder.

This is very handy to have active so that we don't accidentially rename to the wrong names.

But if we happen to make an error when we rename, we can always use Ctrl+Z to undo the changes as well.

Starting with the batch rename will give us a single input field to modify the names of all selected files.

Using this field, we can type anything for a static rename of multiple files, and we can use certain shorthands for dynamic name changes.

For example, we can use a * to refer to any file's current name. Or a ? to refer to the file extension of any of the files we are renaming.

Using sequences to rename files

If we want to use patterns when renaming such as dates, or incrementing by number or letters, we enclose the pattern in the more than and less than signs.

Here are a few examples.

<#00>-* Will create filenames starting from 00 and counting upwards followed by a dash and the original filename. The 00 shows XYplorer to use a two digit count with a leading 0 when counting the first single digit files. 00-textfile.txt followed by 01-textfile.txt for example.

<#5>_* This in turn would count starting from 5 without any leading zeros followed by an underscore and the original filename.

<#a>_* This sequence would use letters instead of numbers, starting from a to continue to b though the whole alphabet. Again following the letter with an underscore and the original filename.

We can also use date sequences to rename files.

For example:

<date yymmdd>-* will rename so that each file starts with todays date, followed by dash and the original name.

For the last modified date, use <datem yymmdd>-* adding an m at the end of date.

We can also use any other date format. For example you can put yyyy for a four digit year count. You can rearrange the order of year month and date as well as putting dashes between the dates to name a few examples.

Rename photos with the date they were taken

If you want to rename photos, you can also use the <dateexif yymmdd> option. This will use the date the photo was taken instead of today's date or last modified.

Moving files while renaming

If we want, we can also move files while renaming.

For this we use the \ command. Here is an example.

<dateexif yyyy-mm>\* will create a folder for each month and put the files, or photos in this case, in the folder with the correct year and month.

Renaming according to the parent folder

Another feature related to folders is the <folder> command. If used within the batch rename it will result in the name of the parent folder.

So if we have a file called todolist.txt in a folder called monday and we use this batch rename command:

<folder>-*

The new filename will be monday-todolist.txt.

Rename switches

The last thing we will cover for this batch rename feature is some switches. You can add switches to the end of the pattern.

/e will drop the files current extension. It is then up to the pattern to add a new extension back in. For example, we could create csv files out of text files by doing this:

*.csv /e

/s will allow us to skip files if there is a collision after all files have changed their names and /i will increment any collisions instead, appending a -01 to the first collision, a -02 to the next and so on.

We can also use /o to overwrite on collision.

Last is /u. This allows us to uppercase the first letter. For example, * /u will change the first letter on each file being renamed to an uppercase.

What does the batch rename quick options do?

So far, we have just covered the first batch rename option. There are several more like regexp that is a more advanced option than the more user friendly batch rename prompt. We can also use other options like search and replace or set extension.

However, now I want to focus on the quick options below that.

The first option, A* A*.aaa will capitalize each word in the file name but keep any capitalized letters untouched from the original filename except the extension that is put to lower case.

The second option, Aaa Aa.aaa is similar but puts all other letters to lowercase including the file extension.

The aaa.aa.aaa and AAA AA.AAA options put all letters to uppercase or lower case while *.aaa and *.AAA does the same for the extension only.

Next is spaces to _. This makes it so that all_spaces_become_underscore_instead while _ to spaces does the oposite.

The last two more useful quick rename options are UrlEscape and UrlUnescape. THese convert spaces to %20 and back again making spaces url friendly.

Final thoughts

In this article we covered batch renaming in XYplorer as well as some of the quick rename options that may come in handy if we need to work a bit faster.

The batch rename system in XYplorer is quite robust with a lot of options.

If you want to read more about how batch renaming works in XYplorer I suggest that you read up on it in the manual that you can find here:

External content: XYplorer manual

I hope it was helpful and thanks for your time.