# Bulk rename of files

**URL:** <https://boards.straightdope.com/t/bulk-rename-of-files/773076>\
**Category:** Factual Questions\
**Created:** [November 26, 2016, 7:56pm UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076 "2016-11-26T19:56:10Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![K364](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/k364/32/5_2.png) [@K364](https://boards.straightdope.com/u/K364)\
**Post date:** [November 26, 2016, 7:56pm UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/1 "2016-11-26T19:56:10Z")

</div>

I have hundreds of files named like:  
11c Summertime.mp3

I want to lop off the first four characters to rename as:  
Summertime.mp3

Anyone know how to do this in a .bat or .cmd?

---

<div class="post-metadata">

**Author:** ![voltaire](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voltaire/32/313_2.png) [@voltaire](https://boards.straightdope.com/u/voltaire)\
**Post date:** [November 26, 2016, 8:02pm UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/2 "2016-11-26T20:02:29Z")

</div>

Why be a masochist? Just use something like [Ant Renamer](http://www.antp.be/software/renamer).

---

<div class="post-metadata">

**Author:** ![Darren\_Garrison](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/darren_garrison/32/92_2.png) [@Darren\_Garrison](https://boards.straightdope.com/u/Darren_Garrison)\
**Post date:** [November 26, 2016, 8:07pm UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/3 "2016-11-26T20:07:55Z")

</div>

> [@K364](#):
>
> I have hundreds of files named like:  
> 11c Summertime.mp3
> 
> I want to lop off the first four characters to rename as:  
> Summertime.mp3
> 
> Anyone know how to do this in a .bat or .cmd?

If they are all mp3s, and they all have the proper metadata stored for them, there are MP3 managers (can’t think of the name of the one I use at the moment, it is a shareware program that is multiple years old) that will allow you to bulk rename files based on that metadata (for instance renaming them “title” - “artist”.mp3, or “artist” - “title”.mp3, or various other combinations.

---

<div class="post-metadata">

**Author:** ![voltaire](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voltaire/32/313_2.png) [@voltaire](https://boards.straightdope.com/u/voltaire)\
**Post date:** [November 26, 2016, 8:30pm UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/4 "2016-11-26T20:30:47Z")

</div>

> [@Darren\_Garrison](#):
>
> If they are all mp3s, and they all have the proper metadata stored for them, there are MP3 managers (can’t think of the name of the one I use at the moment, it is a shareware program that is multiple years old) that will allow you to bulk rename files based on that metadata (for instance renaming them “title” - “artist”.mp3, or “artist” - “title”.mp3, or various other combinations.

I’m sure there are mp3 managers that do it, but Ant Renamer [does it all](http://www.antp.be/software/renamer/features)!

---

<div class="post-metadata">

**Author:** ![Mentor\_and\_Liar](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mentor\_and\_Liar](https://boards.straightdope.com/u/Mentor_and_Liar)\
**Post date:** [November 26, 2016, 9:09pm UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/5 "2016-11-26T21:09:10Z")

</div>

From the command prompt, I think I would try navigating to your directory and typing the following command;

rename “_.mp3" "////_.mp3”

It’s been a long time and I don’t have a Windows machine to test it. Good luck.

---

<div class="post-metadata">

**Author:** ![aceplace57](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/aceplace57/32/3500_2.png) [@aceplace57](https://boards.straightdope.com/u/aceplace57)\
**Post date:** [November 26, 2016, 10:54pm UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/6 "2016-11-26T22:54:30Z")

</div>

[http://rename.lupasfreeware.org](http://rename.lupasfreeware.org)

Is free and has a preview of the file name changes before committing.

I’ve used Lupas Rename for over 12 years.

---

<div class="post-metadata">

**Author:** ![Dewey\_Finn](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dewey_finn/32/4222_2.png) [@Dewey\_Finn](https://boards.straightdope.com/u/Dewey_Finn)\
**Post date:** [November 27, 2016, 12:47am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/7 "2016-11-27T00:47:29Z")

</div>

I thought lupus was _never_ the answer.

---

<div class="post-metadata">

**Author:** ![septimus](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/septimus/32/410_2.png) [@septimus](https://boards.straightdope.com/u/septimus)\
**Post date:** [November 27, 2016, 12:53am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/8 "2016-11-27T00:53:27Z")

</div>

The Unix/Linux command line or command scripts can do complicated things with relative ease. When I wanted to do a mass Windows renaming like this on a dual-boot machine, I often booted Linux just to do the renaming! These days I use Cygwin so no reboot would even be needed.

When I see the suggestions to download a _Dancing\_Pigs\_Renamer_ program to do something that would be rather easy with the Unix or Cygwin command language, I recall an anecdote about the _rot13_ trivial encryption sometimes encountered:

In a discussion I tried to use _rot13_ as an example of Unix’s power. It is performed from the command-line simply by invoking the general _tr_ facility:  
tr a-zA-Z n-za-mN-ZA-M  
and of course a permanent alias can be created if you do this more than once. The scoffers laughed, saying it was trivial in Windows also: Just download a _rot13_ shareware program! :smack: Presumably the shareware _rot13_ had a splendid GUI, perhaps with animations of dancing animals!

I’m sure detractors will use this as proof that my methods are barbaric and obsolete, but the space in OP’s filename(s) _would_ slow me down. But I don’t think OP has Cygwin anyway …

---

<div class="post-metadata">

**Author:** ![Tim\_T-Bonham.net](https://avatars.discourse-cdn.com/v4/letter/t/46a35a/32.png) [@Tim\_T-Bonham.net](https://boards.straightdope.com/u/Tim_T-Bonham.net)\
**Post date:** [November 27, 2016, 2:20am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/9 "2016-11-27T02:20:07Z")

</div>

> [@K364](#):
>
> Anyone know how to do this in a .bat or .cmd?

```auto

DIR \mydir 11c*.mp3 /b >renamer.bat

```

That will get you a list of all the filenames only in file renamer.bat.

Then use a text editor on that file to reformat it into rename commands like this:

```auto

RENAME 11c Summertime.mp3 Summertime.mp3
RENAME 11c Autumntime.mp3 Autumntime.mp3
RENAME 11c Wintertime.mp3 Wintertime.mp3

```

(Basically copy the list a 2nd time, shift that list over 40 columns. overlay it onto the first list, and then do change all/replace commands on the rightmost column to get the new name you want.

Then run that batch file and it will do all the renames.

---

<div class="post-metadata">

**Author:** ![Dewey\_Finn](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dewey_finn/32/4222_2.png) [@Dewey\_Finn](https://boards.straightdope.com/u/Dewey_Finn)\
**Post date:** [November 27, 2016, 2:36am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/10 "2016-11-27T02:36:41Z")

</div>

If you have Microsoft Office on the computer, you can muck about with the file list to add the rename command using a combination of Excel and Word.

(I’m sure there are other, simpler ways to create the batch file, but that’s the way I did it.)

---

<div class="post-metadata">

**Author:** ![GreenWyvern](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/greenwyvern/32/2834_2.png) [@GreenWyvern](https://boards.straightdope.com/u/GreenWyvern)\
**Post date:** [November 27, 2016, 4:33am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/11 "2016-11-27T04:33:32Z")

</div>

[XYplorer](https://www.xyplorer.com/) will easily do bulk renames. Just select all the files you want to rename and press F2 to start the bulk renaming feature.

It’s also the best file manager I’ve ever come across, and I’ve tried many over the years. It has a 100% free version which includes the bulk rename feature - and practically everything else you will ever want or need. It’s also highly customizable in the way it looks and works.

---

<div class="post-metadata">

**Author:** ![Projammer](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/projammer/32/559_2.png) [@Projammer](https://boards.straightdope.com/u/Projammer)\
**Post date:** [November 27, 2016, 5:30am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/12 "2016-11-27T05:30:59Z")

</div>

I like [Bulk Rename Utility.](http://www.bulkrenameutility.co.uk/Main_Intro.php) It’s got every option for filename manipulation I’ve ever needed or could imagine needing.

---

<div class="post-metadata">

**Author:** ![Cerowyn](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Cerowyn](https://boards.straightdope.com/u/Cerowyn)\
**Post date:** [November 28, 2016, 1:14am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/13 "2016-11-28T01:14:51Z")

</div>

PowerShell is part of the last few versions of Windows, and the following syntax will do what you want:

Get-ChildItem \*.mp3 | Rename-Item -NewName { $\_.name -Replace ‘^…’, ‘’ }

This will drop the first four characters from the file name for MP3 files in the current directory.

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [November 28, 2016, 1:23am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/14 "2016-11-28T01:23:40Z")

</div>

Used this one for years - [Rename mp3 files. 1-4a-rename. Freeware file renamer for Windows 95/98/2000/XP](https://www.1-4a.com/rename/)

---

<div class="post-metadata">

**Author:** ![Saintly\_Loser](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saintly_loser/32/4045_2.png) [@Saintly\_Loser](https://boards.straightdope.com/u/Saintly_Loser)\
**Post date:** [November 28, 2016, 1:58am UTC](https://boards.straightdope.com/t/bulk-rename-of-files/773076/15 "2016-11-28T01:58:46Z")

</div>

> [@Projammer](#):
>
> I like [Bulk Rename Utility.](http://www.bulkrenameutility.co.uk/Main_Intro.php) It’s got every option for filename manipulation I’ve ever needed or could imagine needing.

This… We use it at work. It’s fantastic.
