15

I moved all my songs off my phone to a flash drive. Then I uploaded them to my new phone, only when they were stored to the flash drive they come over missing the ".mp3" so they are seen as "file". If I rename each file, adding the ".mp3" the file switches back to an audio file and plays just fine but there are 167 songs.

Is there a way to add the ".mp3" extension to all of them at once instead of one at a time?

I'm using my Windows 7 laptop to rename the songs on the flash drive. I selected all files names and right-clicked and hit rename. I entered the .mp3 and it rewrote every file to that one title, but it didn't add the .mp3. What should I do now?

  • 1
    How did you loose the mp3 extension ? My phone doesnt touch the file extension – eagle275 Feb 24 at 13:00
  • 1
    May I recommend BulkRename. There's even a portable version. – stackzebra Feb 25 at 11:42
  • @eagle275 I'm guessing it was an iPhone? Apple products famously don't care about file extensions, storing the file type in a hidden metafile instead, which can cause confusion when transferring files between some Apple and non-Apple OS's. – Darrel Hoffman Feb 25 at 14:31
41

I often use a command in Command Prompt in Windows, it's REN. The purpose is to rename a file or more.

ren oldfile.png newfile.png

But in this case, you need to rename multiple files, then we can make the command like this:

ren * *.mp3

In that, the first * is to declare all files and the second is to change all files to .mp3

Make sure you move all files to a folder and run the command in this folder.

|improve this answer|||||
  • 6
    To be specific, this will append .mp3 to all files in the current directory ONLY (not subdirectories) – hLk Feb 24 at 2:40
  • 4
    Same answer has been given by phuclv few hours earlier – Daniel W. Feb 24 at 21:21
  • @DanielW. It does boil down to the same answer but this answer provides more relevant details, especially for beginners who must wield the potentially daunting cmd tool. The simple example is also IMO helpful for noobs to understand what is going on. – glenneroo Feb 25 at 19:47
  • But a noob is going to have a harder time finding cmd as opposed to PowerShell, which is now the default shell. – Keith Miller Feb 26 at 19:29
32

Just run ren * *.mp3 in cmd. You don't need 3rd party solutions in this case

|improve this answer|||||
  • 2
    Funny how powerful a basic cmd command sometimes appears. I don't think you can do it in a similarly simple way in bash on Linux. Though you can install the rename utility (not from util-linux!) and do something similar. – Ruslan Feb 23 at 17:22
  • 4
    @Ruslan Not quite as simple, but for file in *; do mv "$file" "$file".mp3; done should work. – pizzapants184 Feb 23 at 21:32
  • @pizzapants184 yeah, that's straightforward, but far from being as laconic as the cmd example. – Ruslan Feb 23 at 21:46
  • 1
    @WGroleau if you mean Kaplan Kim's answer, it was written two hours later, not earlier. – Ruslan Feb 23 at 21:48
  • 1
    @AhmedMasud It's just a different philosophy. Unix-y shells usually expand wildcards, DOS/Windows doesn't. This makes Unix-y utilities simpler and usually more composable ("lots of small extremely simple utils"), but individually less powerful and more confusing (enjoy using * in a folder with files named something like -a or -rf :D). I always preferred having each application decide how to handle wildcards and I don't see wildcard expansion as particularly useful - it's more a dangerous misfeature :) – Luaan Feb 25 at 8:36
14

LOL. so you have a bunch of numbered extensionless music files? Well, we can get the extension fixed so you can play the files. Also, once they're recognized as .mp3 files, they most likely will be metadata that can help restore meaningful names. But first things first.

This can be done with a few lines of PowerShell. If you'll please edit you question to provide paths & example names, as well as clarify if all the files are in one folder or a folder with subfolders. Are the extensionless .mp3 files mixed in with other file types?

For the time being, I'll assume the easiest, all files need the extension added & are in a single folder or its subfolders. The code is simply:

( Get-ChildItem 'c:\Music\Folder' -File -Recurse ) |
    Rename-Item -NewName { '{0}.mp3' -f $_.Name }

and for those that value brevity:

gci | ren -N {"$_.mp3"}

and that's it! Your files should be renamed.

|improve this answer|||||
  • 4
    how is this easier than simple ren command? – eis Feb 23 at 17:19
  • 4
    @eis I also thought of writing this comment, but then noticed the -Recurse flag, which isn't easy to do with ren. – Ruslan Feb 23 at 17:23
  • 9
    @eis my point is that this answer, being more general, might be useful for other users that need recursive processing. – Ruslan Feb 23 at 17:40
  • 2
    Tahnk you, Russian. I could have posted the shortest, situation-specific code: gci | ren {$_.mp3}, but if I was only concerned with the OP, I woulndn't bother. The code I posted (in additon to solving the problem-at-hand) gives simple examples of 1) recursion, 2) use of a acriptblock as a parameter, and 3) the -f format operaotr. The NewName can be constructed from anythign -- metadata, hashtable lookup, random-number generator. Use of full cmdlet names means easier internet seraches for the intellectually curious -- "we'll talk about aliases in the next chapter." :D – Keith Miller Feb 23 at 19:36
  • 2
    Furthermore, PowerShell is now the default shell in WIndows 10, finding cmd is a challenge for some (yes, I know the OP is on Win7). While I have great respect for experienced batch programmers, I cringe when I see someone trying to learn batch at this point. I was a whiz with Assembler on the 8086 processor back in the day, but I accept the fact that its time has passed. The only valid reason for learing cmd/batch today ia maintaining legacy systems. Even then, any worthy pro would be updating that code! – Keith Miller Feb 23 at 19:51
6

Ex Falso free open source audio tag editor for Windows/Mac/Linux can do exactly what you want. Ex Falso automatically identifies all mp3 files as mp3 whether they have an .mp3 extension or not. Just select all the songs in Ex Falso, select the Rename Files tab, click the Preview button to preview the results of the batch rename operation, and click the Save button to batch rename them.

Ex Falso is a GUI application, so you can browse to the files to be renamed and batch rename them wherever they are located. You don't need to move all the files into the same folder.

Ex Falso can also edit song metadata tags in several different ways.

  1. Delete all song metadata tags.

  2. Batch edit song metadata tags.

  3. Automatically generate the tags from the path (for example song titles).

  4. Automatically rename songs from their tags.

  5. Automatically add numbers to songs' names from their track number tags.

|improve this answer|||||
  • 1
    If the tracks are properly tagged, this is a great option. I used to do this on a regular basis after correcting tags on my music to have consistent filenames. – JPhi1618 Feb 24 at 20:13
2

Have you tried Command Prompt?

  1. Open up desired folder in windows Explorer.
  2. Select address bar and with it selected type "cmd" and press Enter. It will open up a Command Prompt in folder's path.
  3. Paste the following command in the Command Prompt: for /f %i in ('dir /b') do move "%i" "%i.mp3" and press Enter.

Enjoy.

|improve this answer|||||
2

PowerToys is an official tool from Microsoft, that includes the PowerRename tool. It has a clear GUI, which makes it easier to use (but harder to automate). It also has some options for supporting smarter logic and will list any changes, so that you know what will happen in advance.

In your case you should perform the following steps after installing PowerRename:

  • Select all files
  • Right click a file and select PowerRename
  • Define the renaming pattern.
    • (Make sure to select Use Regular Expressions)
    • $ means end of sentence
    • We replace this ending with .mp3
  • Visually inspect the output and select Rename

enter image description here

Do note that it only works on more recent versions of Windows 10.

|improve this answer|||||
  • This won't work with windows 7 (or 8, or even 10 if it's too old). – Gerald Schneider Feb 25 at 9:05
  • @GeraldSchneider good point, I missed that from OP's post and I've added it to my post – Ivo Merchiers Feb 25 at 11:02
1

Best tool for that is Total Commander. It has batch rename tool with batch extension edit feature + preview.

Multi-Rename Tool

|improve this answer|||||
  • +1. Also you could do the same with Double Commander, an open source total commander alternative – Sanya_Zol Feb 25 at 22:15
0

If selecting all then renaming them with the .mp3 suffix didn't work, it may be that you have the Hide extensions for known file types option ticked.

You can find this option in File Explorer under File > Change folder and search options
Shown here

Once in Folder Options, click the View tab, under Advanced settings untick Hide extensions for known file types
Shown here

You should then be able to select all files and add .mp3 to the end.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.