Skip to content

Instantly share code, notes, and snippets.

@vadyua
Last active July 7, 2016 07:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadyua/ed2cb541c50776978e46 to your computer and use it in GitHub Desktop.
Save vadyua/ed2cb541c50776978e46 to your computer and use it in GitHub Desktop.
Powershell script to strip Id3v1 tags from MP3s
<#
----------------
Powershell script to strip Id3v1 tags from MP3s | ©2016 by (v)
----------------
Uses Library: http://download.banshee.fm/taglib-sharp/2.1.0.0/taglib-sharp-2.1.0.0-windows.zip
#>
Param (
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true,HelpMessage="Provide a full path to files")]
[ValidateScript({Test-Path $_ -PathType 'Container'})]
[alias("p")]
[System.String]$path
)
[Reflection.Assembly]::LoadFrom("C:\_path_\taglib-sharp-2.1.0.0\taglib-sharp.dll") | Out-Null
Get-ChildItem -LiteralPath $path -Recurse -Force -Filter "*.mp3" | %{
$m = [TagLib.File]::Create($_.Fullname)
$m.RemoveTags([TagLib.TagTypes]::Id3v1) # TagTypes.Id3v1 && TagTypes.Id3v2
$m.Save()
Write-Host "Striped Id3v1 from:", $_.Fullname
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment