Script in PowerShell to write ID3 tags based on file names (tracknumber-Title-Artist.mp3). Based on the article published on http://huddledmasses.org/editing-media-tags-from-powershell/.
Dll requiered: http://www.taglib-sharp.com/Download/
[Reflection.Assembly]::LoadFile(“c:\work\taglib-sharp.dll”)
foreach ($f in dir -recurse -filter *.mp3)
{
$media = [TagLib.File]::Create($f.FullName)
$splitName = $f.Name.Split(”-”)
$i = 1
foreach($p in $splitName)
{
switch ($i)
{
2{ $media.Tag.Title = $p}
3{$media.Tag.Performers= $p.Replace(’.mp3′,”)}
}
$i++
}
$media.Save()
}
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.