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?
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?
Why be a masochist? Just use something like Ant Renamer.
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!
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.
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.
I thought lupus was never the answer.
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 …
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:
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.
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.)
XYplorer 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.
I like Bulk Rename Utility. It’s got every option for filename manipulation I’ve ever needed or could imagine needing.
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.
Used this one for years - Rename mp3 files. 1-4a-rename. Freeware file renamer for Windows 95/98/2000/XP
This… We use it at work. It’s fantastic.