How do you quickly remove underscores from folder names?

3

4

What is the easiest and fastest way to remove underscores from folder names in Windows?

Running a Google search I found a VB script that automatically removes all underscores from file names in the current directory when run. It's simple enough. But it doesn't work with folders.

What I would like to do is to remove all underscore characters for all the folders in the current directory, so that instead of john_smith I get John Smith. How do I do that?

I know that there are hundreds upon hundreds of different batch renaming tools for Windows on the web. But most of the ones I have come across require that the user uses regular expressions to describe the problem and also to describe what the new name should look like. That's not very easy or user friendly.

Can you at least point me to a good batch renaming tool that's easy to understand, and that is able to rename folders? I don't want to randomly install and uninstall some useless bloatware.

Samir

Posted 2012-07-29T19:42:13.217

Reputation: 17 919

you should not be afraid of one using regular expressions. find _, replace with space. The regular expression to match an _, is you guessed it, _. The regular expression to match a space, is, you guessed it, space. Any tool that can rename folders, and uses regular expressions, will not be made harder by it using regular expressions. You just need a tool that is nice for you to use. – barlop – 2012-07-29T19:48:29.910

@barlop You're absolutely right! I overlooked the "search for" and "replace with" fields in programs like muCommander, etc. But I have seen some complicated renaming tools that don't have any such text fields, where they expect you to describe everything with regular expressions, and not by any standard means - instead you have to use their own markers with certain characters within square brackets. But of course there are better programs, like Bulk Rename Utility mentioned below. – Samir – 2012-07-31T17:19:38.630

square brackets have a usage like if you want to specify a character range you can say [A-Z] or if you want a nice shorthand for saying "this character or this character or this character", then you can say [,;%] for one character that is comma or semi-colon, or percentage. But for an underscore, the complete regex to match an underscore, by "standard means" is just that, an underscore. No "special markers"!And if it took more than an _ to match an _,then it is not using regular expression syntax. I'd be surprised if you found a program that didn't match an _ with just an _.Especially regex – barlop – 2012-07-31T17:45:15.373

Answers

5

Bulk Rename Utility is a lightweight program that can accomplish this. In addition to supporting the use of regular expressions, it also has features to accomplish what you want in a more user-friendly way.

To use Bulk Rename Utility, install and start the program (there is also a portable version if you don't want to install it), and navigate to the folder that contains the folders you want to rename. Then, select all of the folders you want to rename.

In order to replace all underscores with spaces, in the Repl. (3) section at the bottom, type an underscore in the Replace box and a space in the With box.

Replace

In order to change the names to Title Case like in your example, use the Case (4) section. Choose Title from the drop-down menu.

Case

Look at the names in the New Name column and make sure that they are what you want. When you are done, click Rename in the lower-right corner.

bdr9

Posted 2012-07-29T19:42:13.217

Reputation: 2 508

That was very helpful. Thanks! I also tried using Free Commander and muCommander with successful results. I have used muCommander in the past for renaming files, but little did I know that it works with folders too. The Free Commander was new for me and it did what it was supposed to do. The muCommander is a little buggy, or it just feels laggy for renaming operations. – Samir – 2012-07-31T16:57:34.477

To compare with the example above, it's as if it first creates a new folder titled Elvis Presley on the same location as the old folder. Then it copies all the files from the old folder titled elvis_presley after which it would delete the files in the old folder and also delete the old folder itself, leaving you with a new folder with the new title, and with all your files in it, on the same location. That's "bulk renaming" a la muCommander way. It's terrible! – Samir – 2012-07-31T17:02:06.390

I noticed this behavior because I often got messages saying that there is already a file or a folder with that name on the same location when some bulk rename operation would go wrong, and it would ask if I want to overwrite the existing etc. I guess they somehow were trying to make it avoid having file or folder duplicate conflicts, but ironically that's exactly what their program is doing. It's not well thought out. I think it's due to the moving or copying of the files from one folder to another, instead of simply renaming the existing folder. They made it too complex. – Samir – 2012-07-31T17:07:10.580

I didn't have this problem with Free Commander though. Many of these "commander" style of file managers have a bulk-rename feature of some sort built-in that allow you to do some fast renaming of files (and folders). I wish that Explorer in Windows had some of this stuff built into it. But if not, I much rather prefer a stand alone renamer like Bulk Rename Utility (BRU). Thanks for the tip! So far I have used it couple of times now and it works great. I have not had much luck with these rename tools in the past, but I hope BRU will serve me well. Thanks again! – Samir – 2012-07-31T17:10:25.393

0

A Windows Batch file let you double click it which will quickly change underscores in a directory to something else.

How to replace a single character in Windows filenames using a batch file?

Eric Leschinski

Posted 2012-07-29T19:42:13.217

Reputation: 5 303

0

You can also try http://www.binarymark.com/Products/BatchFileRename/default.aspx if you require more power and flexibility as it supports RegEx and EXIF tags.

George

Posted 2012-07-29T19:42:13.217

Reputation: 282