-> Home

Adjust ID3 tag or Vorbis comments and filenames automatically

Release: 0.12

→ features → download → installation → usage → examples → history → todo → contact



This program is distributed under the terms of the GNU GENERAL PUBLIC LICENSE.

ZIP file with REXX script and this guide: <Download>

Currently this script is dedicated to OS/2. There are some features around the code page translations which relate to OS/2 specific REXX extension and a custom OS/2 DLL module.



mp3tag [filemask] [options]

If filemask is omitted *.mp? *.ogg is used.

/s Include subdirectories
/ntemplate Naming convention [1]
This is the filename (including path) for all MPEG files. It may contain the following meta characters[2]:
%a    Artist name
%t Song title
%A Album name
%T Track number (two digits)
%y Year
%c Comment
%. Current directory including trailing \
%\ Directory of the file including \
%$ Filename without extension
%~ File extension including .
%% % itself
Further examples
/n0 Shortcut for /n%.%a\%t%~
Sort files by artist\title.mp3. (default)
/n1 Shortcut for /n%.%a\%A\%T - %t%~
Sort files by artist\album\track - title.mp3.
/n2 Shortcut for /n%.%A\%T - %a - %t%~
Sort files by album\track - artist - title.mp3.
/aT Try to determine Track number automatically (if missing)
If the track number is missing in the tag information (e.g. ID3 tag V1.0), mp3tag tries to determine it automatically from the filename. In fact it searches for a two digit number at the end and the beginning of the name.
/oaartist Overwrite artist
/oAalbum Overwrite album
/oyyear Overwrite year
/occomment Overwrite comment
/osstyle Overwrite style
Only by number!
/u Update ID3 tag from filename
Priority: parsed filename, old tag (if any), overwrites (/o...)
/U Update ID3 tag from filename
Priority: old tag (if any), parsed filename, overwrites (/o...)
/!_ [3] or
Do not convert underscores in filenames to spaces
This is done by default. However, mp3tag will never create underscores instead of spaces.
/ac Automatic case conversion
Convert first character of all words to uppercase. This applies only to artist, album and title and not to overwrites (/o...).
/!cp [3] or
Disable codepage translation
By default, all MP3 tags are converted from the ISO-8559-1 (Windows) character set to the OS/2 code page on read and vice versa on write.[4]
/eatype set file type extended attribute (.TYPE) to type
/L Always set .LONGNAME extended attribute to match the file name without extension.
/pm Use the PMShell for file renaming & moving
There are two distinctions to the default method (MOVE command):
- First, the mapping for special characters which are not allowed in filenames is different. However, in both cases the .LONGNAME EA will contain the exact name. Furthermore, the .LONGNAME EA is normally only created on demand.
- Secondly, the MOVE command will fail, if the destination is on a different volume whereas SysMoveObject will not.
/t Truncate trailing zeros
Sometimes I got files with some trailing zeros after the ID3 tag. This switch will try to remove them automatically and above all enable the ID3 tag to be recognized at all.


  1. The ID3v1.x tag have a restriction of 30 characters per field. When renaming files mp3tag tries to keep longer items by searching the old file and path name for the remaining characters.
  2. The escape character * may be used alternatively instead of % because the latter is usually the shell escape for environment variables. In fact there is no way to pass a % as parameter by a WPS program object.
  3. If you use the FileCommander shell, remember that ! is an escape character there. You need to type !! instead. Alternatively you may use a backslash.
  4. The documentation of the ID3v1.x tag structure does not mention the code page problem. But however, ID3v2 tags are using ISO-8559-1, which is similar to the one used by Windows and Linux systems. Usually the ID3v1 tags are also ISO-8559-1 format. Use \!cp if you have (or want to have) ID3 tags with the OS/2 code page.


Renaming and moving files:

mp3tag /s
Rename and move all mp3 files in the current directory and all sub folders according to the rule .\artist\song.*.
mp3tag "/n%.MP3s/%a& - %t" /eaMP3
Rename and move all mp3 files in the current directory to the folder MP3s according to the rule .\MP3s\artist - song, set the .TYPE EA to MP3 and remove the file extension as OS/2 don't need it.
mp3tag /n1 /aT
Rename all mp3 files in the current directory according to the rule .\artist\album\track - song.*.
mp3tag /n2 /aT
Rename all mp3 files in the current directory according to the rule .\album\track - artist - song.*.

Modifying ID3 tags:

mp3tag MP3s\* /u "/ocencoded with lame 3.90a7"
Set the comment tag of all files in the directory MP3s to encoded with lame 3.90a7
mp3tag /u /s "/n%.%A\%T - %a - %t%~"
Update the ID3 tags of any MP3 file in the current directory including sub folders. The folder name where the files are found is considered to be the album name. The file names are parsed as track - artist - song. However, any existing parts of the ID3 tag are kept.


Version 0.12 (25.08.2002)

Version 0.11

Version 0.1


Handle ID3v2 tags
ID3v1 tags have the unpleasant disadvantage that the items are restricted to 30 characters. This is casually insufficient. ID3v2 tags do not have such restrictions. Unfortunately they are much more complicated, in particular with the REXX language.


Suggestions, help, complaints (but not too much:-): Mail address: mueller (at) maazl (dot) de

Original homepage: http://www.maazl.de/project/mp3/mp3tag.html