How to Batch rename a part of a file name?

DaviDaVinci

Golden Member
Dec 28, 2000
1,345
0
0
This is in reference to Yahoo Messenger History folder.

Each of my contacts has a folder and in that folder is a file that has a filename like this.

20050414-myusername.dat

I'm planning on changing my username to something else but want to keep all the logs viewable through Yahoo. Essentially I want to migrate my logs to a new username.

How can I change the 'myusername' part to another name for all the files in all of the contacts folders at once?

Or is there a better way?

Want to do the same for MSN Messenger
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
Perl? I'll write the pseudocode but I'm guaranteed to get the syntax horribly messed up so someone else can fill that out.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
Google for Bulk Rename Utility, single executable and works well for windows. Perl would work well, and is what I would use on Linux, but I have issues with Perl in Windows
 

cubby1223

Lifer
May 24, 2004
13,518
42
86
Or you can just use the rename command from a cmd window. In that situation would be:
ren *.dat ?????????newusername.dat