Have you ever needed to rename a folder full of sequential files? Batch Rename is an easy-to-use but powerful tool to do just that. This program for Windows uses a regular expression to match and replace portions of file names. Parts of file names can be captured and re-inserted into the replacement string using .Net’s syntax. For a good cheat-sheet on .Net regex syntax, go here.
Upon opening, the user is presented with 3 textboxes and 3 buttons. Here, the user can enter the full path name of the folder, the regex expression to use in matching file names, and the replacement expression to rename files as. The buttons open a folder browsing window, list the files that match the current regex, and execute the rename.
For example, if there is a folder C:\mytest which contains some XHTML files named text00.xhtml, text01.xhtml,... and so on, using Batch Rename, they can be renamed to part00.xhtml, part01.xhtml,....
The regex to use is text(\d+).+. Note that the numerical part of the file name is captured with (\d+) so it can be re-inserted into the new file name, and preserve the numerical order of the files. Also, each file must be given a new unique name, and the number will be the only unique part in this case. After entering the regex, the user can press “List Matches” to see a list of the file names which match the regex.
If that is satisfactory, continue and enter the replacement string. In this case, it is part${1}.xhtml because the regex matches all the characters in the file name and captures the numerical part in the 1st capture group. Therefore the entire file name will be replaced with the replacement string, instead of just a sub-string of the file name. ${} is the syntax to use to refer to captured groups.
Since everything is set up, the rename will be performed when the user presses “Run”. The results of the renaming process are shown in the output area.
The program checks for updates once a week.
Updates
- 2010-01-13: The ability to run a test rename. To run a test, simply complete all the fields as normal and press “Test”. Output will appear as normal.
- 2010-01-13: Auto-numbering. To use this, insert a single
#character in the replacement string (in addition to the standard syntax). There are options to zero-pad and to adjust the starting number. To zero-pad, increase the “Auto-numbering digit count” parameter. For example, with this set to3,5would become005.
Download
- Version 1.0.0.1, 2010-01-13, Windows XP, Vista, 7 (.net 3.5): download here
- Version 1.0.0.0, 2009-10-15: Discontinued


