DMEX Rename Tool

Abstract

The DMEXRename tool provides the functionality of the Rename files function from the File Operations menu and shows the Rename Dialog.
You can either Change filenames, Change date & time, Change attributes of all the files selected in the windows explorer window at once or even include all files in the directory including all subdirectories if no file is selected currently.
The changes will be permanently. There is no undo function.

You have to select the files you want to rename in the current windows explorer window before you choose the Rename files option. You can add additional files by drag & drop later.
If no files are selected, the Fileselect Dialog is shown which allows to rename all files/directories in the current directory including the subdirectories.

Dialog

Dialog description

The upper part of the dialog shows a list of the selected files, their filenames in the first column, their old properties (filename, date or attributes) in the second column and their new properties in the third column.
By right clicking in the file list or clicking on the column headers you can open a sort menu which allows to sort the items in the file list by different properties. The sort order of the list is only of interest if the files are renamed using a counter keyword.
Below the list in the middle of the dialog are three buttons “Filename”, “Date & Time” and “Attribute” where you can choose which property you want to change. The area below the buttons changes depending on the selection.
Pressing the button “Change …” at the bottom will perform the changes. Pressing “Close” will close the dialog and discard the changes. Pressing ”?” will open the help page.

Change filenames

In the input field you can enter the new name of the file. You can just type in any text or you can use placeholders which are named keywords in the following.

To add a keyword you can either:

Keyword list

Keyword menu

The menu shows a description on the left and the placeholder to be inserted to the right. Keywords containing $$ or %% signs need further input.
The keywords denote the following:

Original filename [Name], [Name($$,$$)]
The keyword [Name] adds the original filename to the new filename.
The keyword [Name($$,$$)] adds a part from the original filename to the new filename.
You can cut out a part of the original filename by using the [Name($$,$$)] keyword which denotes [Name(startposition,endposition)].
If you enter a negative number as startposition it is counted from the end of the filename, not the beginning.
If you chose [Name($$,$$)] from the menu the Enter numeric value area will be shown to enter the needed parameters.

Original extension [Ext], [Ext($$,$$)]
The keyword [Ext] adds the original file extension to the new filename.
Note, that [Ext] includes the leading delimiter (point) of the extension.
You can also cut out part of the extension by using the [Ext($$,$$)] keyword which denotes [Ext(startposition,endposition)].
If you chose [Ext($$,$$)] the Enter numeric value area is shown below the input field to enter the needed parameters.

Replace part of the filename [Rep(%%,%%)]
The keyword [Rep(replacewhat,replaceby)] will replace a part of the original filename by a given text. The replacement is performed after all other changes have been done. The position of the [Rep(%%,%%)] keyword in the input field is not important.
If you chose [Rep(%%,%%)] the Enter replace strings area is shown below the input field to enter the needed parameters.

Drive letter [Drive]
The keyword [Drive] adds the drive letter of the path information of the current file.
If the full path of the file is “c:\programs\dmex\readme.rtf" [Drive] returns “c”.

Directory name [Dir-1]
The keyword [Dir-1] adds the name of the directory of the current file.
If the full path of the file is “c:\programs\dmex\readme.rtf” [Dir-1] returns “dmex”.

Parent Directory name [Dir-*$$]
The keyword [Dir-*$$] adds the name of any parent directory of the current file. The Enter numeric value area is shown to enter the directory level value.

File date and time [Filedate:fd]
The keyword [Filedate:fd] allows to enter the files date and time to the filename. The Enter Filedate information area which is shown to choose the type of file date (creation, last write or last access) and the string format used. The string formats are the same as for the Exif Date keyword and are described here.

Counter [N], [N:$$], [N:$$:$$], [N:$$:$$:$$]
The keyword [N] will add an inclining number to each filename starting with zero "1".
Using [N:$$], [N:$$:$$] or [N:$$:$$:$$] which denotes [N:a:b:c] allows to format the number.
Where "a" denotes the 'width' of the number, so if the number has less digits than "a", leading zeros or blanks are inserted. "b" denotes the starting number (default is zero "1"). And finally "c" denotes the step by which the number is increased for every file.
[N:1:1:1] is the same as [N].
[N:3:7:2] will add 007 to the filename and increase the number by two for each following file. The result is a three digit number (parameter a=3) and the first file starts with seven instead of one (parameter b=7).
If you chose [N:$$], [N:$$:$$] or [N:$$:$$:$$] the Enter file count area is shown below the input field to enter the needed parameters.
By right clicking in the file list or clicking on the column headers you can open a menu which allows to sort the items in the file list by different properties. The sorting of interest if the files are renamed using a counter.

Photo information (Exif Tag) [Exif(...)]
This menu item shows a submenu with different options to add information from the Exif header of a photo. This only works with files containing an Exif header.
The "Date" option adds the time of exposure of a photo to its filename.
The format of the date can be defined using the Exif date format dialog.
You can also select other Exif Tags which are not in the predefined list. In this case the Enter additional information area is shown.

MP3 song information (MP3 Tag) [ID31(...)]
This menu item shows a submenu with different options to add information of the MP3 header of a music file. This only works with files containing an MP3 header.
With this option you can rename songs by their artist or song name.
You can also select other MP3 Tags which are not in the predefined list. In this case the Enter additional information area is shown.

Change case to uppercase [Uppercase]
The keyword [Uppercase] changes all letters of the filename to upper case. There is no need to add this keyword multiple times.
If you just want to change the current filename to uppercase you have to use [Name][Ext][Uppercase].

Change case to lowercase [Lowercase]
The keyword [Lowercase] changes all letters of the filename to lower case. There is no need to add this keyword multiple times.
If you just want to change the current filename to lowercase you have to use [Name][Ext][Lowercase].

Change case to capitals [Capitals]
The keyword [Capitals] changes the first letter of all words of the filename to upper case. There is no need to add this keyword multiple times.
If you just want to change the current filename into capitals you have to use [Name][Ext][Capitals].

Examples:
You want to rename all selected files to *.bak. (Test.txt to become Test.bak)
Use: [Name].bak
You want to rename all "*.bmp" files to "My Girlfriend xx.bmp" where xx denotes a sequential number
Use: My Girlfriend [N][Ext] or My Girlfriend [N].bmp
You want to number all "*.bmp" files with a sequential number starting with 5 and all numbers should have a width of three digits. The first file to be: Oldname005.bmp.
Use: [Name][N:3:5][Ext]
You want to double the filename in a way that Test.txt becomes TestTest.txt.
Use: [Name][Name][Ext].
You want to insert a tilde (~) as first character of the extension in a way that Test.txt becomes Test.~xt.
Use: [Name].~[Ext(3,255)]. Note the dot between [Name] and ~[Ext]!
You want to change the filename to upper case
Use: [Name][Ext][Uppercase].

Change filedate

Select the new date and time of the files in the input fields. As default the time is set to the current date and time.

With the three checkboxes you can select which of the three file timestamps you like to change.
The list at the top of the dialog always shows the “Last write time”.
Press “Change Dates” to perform or “Close” to discard the changes.
If an error occurs the files that could not be changed are indicated by an exclamation icon in the list followed by an explanation of the error. If no error occurs all files are removed from the list.

Change attributes

Select the checkboxes for the attributes you want to set. The attributes are shown in the list as:

Selecting a checkbox will set the attribute on the files. Deselecting the checkbox will remove the attribute from the file.
If the checkbox is greyed the attribute will not be changed. Press “Change Attributes” to perform or “Close” to discard the changes. If an error occurs the files that could not be changed are indicated by an exclamation icon in the list followed by an explanation of the error. If no error occurs all files are removed from the list.
Example: Deselecting all checkboxes will delete all attributes from the selected files.

Fileselect Dialog