Help on passing a file list to MP3tag via CLI and encoding

So, I have some file lists which were exported by other tools that I used to scan my library and now I'm trying to pass these lists to MP3tag. I don't think it's something that could be made manually, as there are over 700 files in different directories (which also contain files that should not be passed).

The method I'm trying to use for this is making a txt file containing nothing else than a fully qualified path (enclosed in double quotes) per line and running this loop:

for /f "usebackq tokens=*" %a in (a.txt) do "C:\Program Files (x86)\Mp3tag\Mp3tag.exe" /add /fn:%a

which seems to be doing it's job, as every file from the list is indeed looped for the MP3tag command as it should.

However, every single iteration fails with a message that the file could not be accessed.

I believe that the error relates somehow to encoding (I have diacritics, such as á, é and ú on both my paths and filenames), so I took a few steps to try and isolate the problem:

  1. Rebuilt Windows' permissions from scratch to ensure every file could be accessed by MP3tag;

  2. When manually typing "C:\Program Files (x86)\Mp3tag\Mp3tag.exe" /add /fn: and then copying and pasting the path from explorer.exe, it works;

  3. I rebuilt my lists paying extra attention to encoding. Every txt file was on UTF-8;

  4. Before running the loop one more time, I changed the encoding on cmd via chcp 65001. No luck;

  5. I repeated the previous steps with ANSI/character set 860, but had the same error;

  6. Tried to rename the txt file to m3u in order to drag and drop to MP3tag, had the same message on a different box.

So now I'm guessing the problem lies in the way that these filepaths are presented to MP3tag, but the reason why step 1 above worked and everything else did not remains a mystery to me.

Other info: I'm on Windows 10 with MP3tag 3.01

Any help is very much appreciated, thank you!

Can't you simply create single text file similar to a playlist which lists the files and then open that file?
Like that you can see what the filenames really look like.

That will work if you remove the double quotes around the paths.
And Mp3tag will accept M3U or M3U8 files when using /fn: on the command line.
You could do something like this:
"C:\Program Files (x86)\Mp3tag\Mp3tag.exe" /fn:"C:\Path to\File List\Files.m3u8"

That's exactly what I have, a text file containing one file path per line and nothing else.

No, it does not. I did also use a version without quotes and all my test, but did it again just to be sure, I still get the error box I described in step 5: a scrollable message saying that "The file [PATH] could not be accessed".

Btw, I'll edit my original post to say that I verified Windows' permissions, MP3tag definitely has access to the files.

You still would have to compare if the file path is something that can be accessed. I still suspect that not all characters match.

Well, I found the problem. I have my User Media Folders in a second HDD, but my OS language is pt_BR, so it turns out that while the program that generated the list used D:\Músicas, as it's shown to me, MP3tag needed D:\Music.

I guess its's Windows' problem, but now I learned another thing to look out for...

Thank you!

1 Like