用PowerShell批量编辑ID3

很多MP3的ID3是BIG5编码的 用下边这个PowerShell脚本可以批量把title, author变成简体中文

$big5 = [Text.Encoding]::GetEncoding(950)
$root = “<your mp3 folder>”
$files = Get-ChildItem $root -Filter “*.mp3” -Recurse
foreach($file in $files) {

 

$wmp = New-object –COM WMPlayer.OCX;

$media = $wmp.newMedia($file.FullName);

$newTitle = $big5.GetString([Text.Encoding]::Default.GetBytes($media.GetItemInfo(“Title”)));

$media.SetItemInfo(“Title”, $newTitle);

$newAuthor = $big5.GetString([Text.Encoding]::Default.GetBytes($media.GetItemInfo(“Author”)));

$media.SetItemInfo(“Author”, $newAuthro);

}

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s