Saturday, July 18, 2009

Powershell script - simple batch renaming

So I've been looking for a simple way to rename my massive
folders of mp3 when transferred to my stinky LG cell-phone which can not group it's
songs & creates a massive disorder in the songs listing.

so the simple solution was to rename all songs with same artists name
to same start (at lists it orders it alphabetically ) to conclude this preface I've looked for
a fast easy way to do this instead of using an app like "magic file renamer", so powershell
was my obvious choice to look for the answer...the web is filled with examples
and I finally put together a simple syntax to make this work -
gci | % {Rename-Item $_ $("rd" + $_.Name ) -whatif } the "Rd" is the new prefix to
assign to all files, have course there a way to filter the data to search for only mp3s
like so -
get-childitem *.mp3 (get-childitem = gci = dir) powershell is cool, makes me woder
how Microsoft developed such an amazing script language.

No comments:

Post a Comment