# Tools: Difference between %\_path% & %\_directory% #& debugging?

**URL:** https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699
**Category:** Support
**Created:** [December 2, 2024, 10:54am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699 "2024-12-02T10:54:16Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Cantello](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cantello/32/7697_2.png) [@Cantello](https://community.mp3tag.de/u/Cantello)
#### Post date: [December 2, 2024, 10:54am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/1 "2024-12-02T10:54:16Z")

</div>

I recently tried to enter a specific tag in a non-standard way to cater for some third-party software (see

> [@Possible to add custom TXXX tag (user-defined text)?](https://community.mp3tag.de/t/possible-to-add-custom-txxx-tag-user-defined-text/66656):
>
> I am in the process of adding my whole audiobook & audio drama collection to audiobookshelf (self-hosted audiobook server). During this process I found out that the built-in series detection of abs does not really work for my folder structure, which is why I used mp3tag to correctly tag all my files. Everything worked fine, except for series. abs expects it to be in the "grouping" field ([[Bug]: Series and series-part do not get embedded when you write meta data to files. · Issue #3547 · advplyr/…](https://github.com/advplyr/audiobookshelf/issues/3547#issuecomment-2440086269)

and found it to be impossible with mp3tag.  
However, one user (hi Sergius!) told me about a command-line tool called id3.exe ([GitHub - squell/id3: ID3 mass tagger](https://github.com/squell/id3)) that can manipulate id3 tags, including the one that I need. Now I wanted to copy a tag generated by mp3tag (I chose TXXX:Series) to the non-standard tag and it worked when using it directly in the terminal. However, once I tried to apply it as a tool within mp3tag it stops working. I suspect something with the path/folder/filename but I can't seem to be able to debug it correctly.

The command line is (don't blame me for the names, it's just something our kids like to listen to... 😁): `.\id3.exe -2 -wTXXX:grouping "%{TXXX:series}" '\\minibox\Audio\Kinderkrams\Hörspiele\Bibi & Tina\Bibi & Tina - Folge 11 Papis Pony (Album)\05 Kapitel 04 - Papis Pony (Folge 011).mp3'`

The parameters for the tool in mp3tag is as follows: ` -2 -wTXXX:grouping "%{TXXX:SERIES}" '%_path%'` - which does not work.  
I tried several other variations, with quotes, double-quotes, `%_path%\%_filename_ext%`, without any success. A terminal window opens and closes immediately, making debugging difficult.

Any ideas?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 2, 2024, 11:25am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/2 "2024-12-02T11:25:58Z")

</div>

Just to be sure:  
Why do you want to use Mp3tag at all if you like to use `id3.exe` anyway?

Could you just copy the content of `TXXX:grouping` to `TXXX:series` with id3?

Sorry, but I don't see why it would be useful to create an external tool and call it with parameters from Mp3tag if you could do this directly with `id3.exe`?

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 2, 2024, 11:31am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/3 "2024-12-02T11:31:23Z")

</div>

Answer to your title questions:

`%_path%` [is the File name with path](https://docs.mp3tag.de/format/#file-name-and-path-information).  
`%_directory%` [is the Name of the file’s parent folder](https://docs.mp3tag.de/format/#file-name-and-path-information).

To debug such parameters, you could use/call a batch CMD file that only shows what you passed to it, stopping with a PAUSE command that waits until you press a key.

---

<div class="post-metadata">

### Author: ![Cantello](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cantello/32/7697_2.png) [@Cantello](https://community.mp3tag.de/u/Cantello)
#### Post date: [December 2, 2024, 11:40am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/4 "2024-12-02T11:40:49Z")

</div>

Thanks for the answers, will try them tonight.

As for the why, I do all of the other tagging & organising in mp3tag, just this one bit I cannot do and thus tried to use an external tool - I thought that is exactly what the tool option is for, right?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 2, 2024, 11:45am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/5 "2024-12-02T11:45:55Z")

</div>

Just a warning: if you edit the files with MP3tag then you will always end up with the standard name for the tag field and not the emulation of a user-defined one.  
The steps would be: finish editing in MP3tag, close MP3tag, proceed with using id3.exe and never touch the files with MP3tag again.  
If you find it convenient to use the list from MP3tag to finish the editing, it may be worth a thought to create an export script that contains all the commands for batch job to call id3.exe for just the edited files.

---

<div class="post-metadata">

### Author: ![Sergius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@Sergius](https://community.mp3tag.de/u/Sergius)
#### Post date: [December 2, 2024, 12:47pm UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/6 "2024-12-02T12:47:01Z")

</div>

> [@LyricsLover](#):
>
> Just to be sure:  
> Why do you want to use Mp3tag at all if you like to use `id3.exe` anyway?
> 
> Could you just copy the content of `TXXX:grouping` to `TXXX:series` with id3?
> 
> Sorry, but I don't see why it would be useful to create an external tool and call it with parameters from Mp3tag if you could do this directly with `id3.exe`?

Hello LyricsLover, it's nice to see you again...

I was trying to help Cantello, with the id3.exe program with a CMD file, for the Tag grouping, based on the file you wrote me...

Here is some info...

> [@On another topic](https://community.mp3tag.de/t/66661/2):
>
> When I edit & embed the series data directly from audiobookshelf, it writes the TXXX:grouping tag:  
> ![image](https://community.mp3tag.de/uploads/default/original/3X/1/b/1b2a161cb39fea949f0a787a429df47061ccccdb.png)  
> When I edit this tag in mp3tag, it is converted into the more standard GRP1 tag:  
> ![image](https://community.mp3tag.de/uploads/default/original/3X/6/5/655126d860002b66fd60854befd4d8019cbda373.png)

---

<div class="post-metadata">

### Author: ![Sergius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@Sergius](https://community.mp3tag.de/u/Sergius)
#### Post date: [December 2, 2024, 12:53pm UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/7 "2024-12-02T12:53:10Z")

</div>

Cantello needs a TAG grouping (tiny), I believe with a .cmd file and id3.exe, there is a way to program this...

---

<div class="post-metadata">

### Author: ![Sergius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@Sergius](https://community.mp3tag.de/u/Sergius)
#### Post date: [December 2, 2024, 1:01pm UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/8 "2024-12-02T13:01:15Z")

</div>

![TAG GROUPING (IMAGE) 1](https://community.mp3tag.de/uploads/default/original/3X/a/e/ae5fbf400b2c195962251a1277ff6a590d79da5a.jpeg)  
 ![TAG GROUPING (IMAGE) 3](https://community.mp3tag.de/uploads/default/original/3X/4/5/45acd135bfa185538ffe368d51efde71f2f0868d.jpeg)  
 ![TAG GROUPING (IMAGE) 2](https://community.mp3tag.de/uploads/default/original/3X/2/5/257f027e5eaa7360b6609610f3b94d561cf15e53.jpeg)

Here are the 2 results with Mp3tag...

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 2, 2024, 1:14pm UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/9 "2024-12-02T13:14:09Z")

</div>

> [@Sergius](#):
>
> I believe with a .cmd file and id3.exe, there is a way to program this...

There is a way - for sure. But I myself would not go the way using Mp3tag for this specific use case. Of course it's Cantello's decision how to procede.

`id3.exe` handles the tags - let's say - very flexible and doesn't care much about existing standards. Thats also the reason why you can write UPPER-/lowercase tags with `id3.exe` or as in this case a `TXXX:grouping` which should be GRP1 according to the ID3v2.3 and ID3v2.4 standard.

But this has already been discussed [here](https://community.mp3tag.de/t/possible-to-add-custom-txxx-tag-user-defined-text/66656) as I read in the meantime.

---

<div class="post-metadata">

### Author: ![Sergius](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@Sergius](https://community.mp3tag.de/u/Sergius)
#### Post date: [December 2, 2024, 1:32pm UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/10 "2024-12-02T13:32:29Z")

</div>

> [@LyricsLover](#):
>
> There is a way - for sure. But I myself would not go the way using Mp3tag for this specific use case. Of course it's Cantello's decision how to procede.

In his public writings, he started talking about the program, id3.exe

That's why, I tried to help him with this method...

> [@Possible to add custom TXXX tag (user-defined text)?](https://community.mp3tag.de/t/possible-to-add-custom-txxx-tag-user-defined-text/66656/21):
>
> Yep, that's what I intend to do but so far I have not yet come across any kind of software to do this in a convenient way. I thought maybe beets could do this but apparently it relies too much on its internal database to simply copy one tag to another. Currently researching [id3](https://github.com/squell/id3), this seems to read the tags but I am struggling to copy the tags.

In our private writings, Cantello wanted to use Mp3tag, for all his tags, including Tag grouping

He will have to use a Tools, for this to work...

---

<div class="post-metadata">

### Author: ![Cantello](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cantello/32/7697_2.png) [@Cantello](https://community.mp3tag.de/u/Cantello)
#### Post date: [December 4, 2024, 8:59am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/11 "2024-12-04T08:59:12Z")

</div>

Now back from travel and trying a batch file. However, it seems as if the path variable is not expanded in my setup, it is just passed as "%\_path%" to the batch file.

The batch file I used is:

```auto
@echo off
echo Parameter provided: %~1 %~2 %~3 %~4
echo Press any key to continue...
pause > nul

```

and the terminal output when invoking on a file in mp3tag is simply (wit the literal path variable in it, not changed according to the file):

```auto
Parameter provided: -2 -wTXXX:grouping %{TXXX:SERIES} %_path%
Press any key to continue...

```

The parameters given in Options-\>Tools is

```auto
-2 -wTXXX:grouping "%{TXXX:SERIES}" "%_path%"

```

Any idea what I might be doing wrong?

---

<div class="post-metadata">

### Author: ![Cantello](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cantello/32/7697_2.png) [@Cantello](https://community.mp3tag.de/u/Cantello)
#### Post date: [December 4, 2024, 9:06am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/12 "2024-12-04T09:06:52Z")

</div>

I would just use id3.exe to copy this particular tag and not let it touch anything else.

One problem with the GRP1 tag (and that is why I hesitate to open a bug report for audiobookshelf) is that it is _not_ part of the id3v2.3 standard ([d3v2.3.0 - ID3.org](https://id3.org/d3v2.3.0)) but rather an Apple-proprietary addition that is now used widely.

As an alternative to id3.exe, does anyone know [eyeD3](https://github.com/nicfit/eyeD3), a stand-alone tool and a python library to modify id3 tags? It seems like it can copy the tag but I have not yet found out how exactly... 🙂

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 4, 2024, 9:41am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/13 "2024-12-04T09:41:43Z")

</div>

> [@Cantello](#):
>
> Any idea what I might be doing wrong?

Don't forget the trailing `%` after Series, please try it with:  
`-2 -wTXXX:grouping "%{TXXX:SERIES}%" "%_path%"`

If that does not work for you, you should provide an example song with your current TXXX:grouping content - to reproduce it.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 4, 2024, 10:40am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/14 "2024-12-04T10:40:44Z")

</div>

> [@Cantello](#):
>
> Any idea what I might be doing wrong?

After some tests - and assuming the information you want to copy is currently saved in the tag SERIES:  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/c/5/c50728362b69a97579a543fdae0d10352c0f23d5.png)  
the Mp3tag parameter to instruct the external 3rd-party commandline tool `id3.exe` to copy the content of SERIES into an additional non-standard `TXXX:grouping` tag would be:

`-2 -wTXXX:grouping "%SERIES%" "%_path%"`

![image](https://community.mp3tag.de/uploads/default/original/3X/9/0/900c200cb858403628d002c7b627b60a39297e44.png)

This would result in:  
 ![image](https://community.mp3tag.de/uploads/default/original/3X/b/6/b60ed492dad70f4a0b602fa58aed3ded45932ef3.png)

**IMPORTANT:**  
Never modify such songs again in Mp3tag. If you do that, the GROUPING tag will be changed from the current non-standard `TXXX:grouping` to `GRP1` without giving you any information.

---

<div class="post-metadata">

### Author: ![Cantello](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cantello/32/7697_2.png) [@Cantello](https://community.mp3tag.de/u/Cantello)
#### Post date: [December 4, 2024, 11:03am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/15 "2024-12-04T11:03:27Z")

</div>

Your are totally right, that was the culprit. I was too blind to see that and I have now verified that it works as intended, thanks!

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 4, 2024, 11:23am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/16 "2024-12-04T11:23:44Z")

</div>

You have selected my answer #13 as solution.  
I assume because of the hint with the % character?

As I just rechecked: The syntax in #13 will NOT work as parameter from Mp3tag and therefore not write an additional non-standard `TXXX:grouping` tag with the content of `SERIES`.

You should use the syntax in answer #14 in Mp3tag for Tools as parameter for id3.exe.

---

<div class="post-metadata">

### Author: ![Cantello](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cantello/32/7697_2.png) [@Cantello](https://community.mp3tag.de/u/Cantello)
#### Post date: [December 4, 2024, 1:50pm UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/17 "2024-12-04T13:50:17Z")

</div>

You mean the difference between `"%{TXXX:SERIES}%"` and `"%SERIES%"`?

Actually, I use `%%{TXXX:SERIES}%%` and it works. id3.exe wants to have the percent symbols and to prevent them from replacement by mp3tag, they are escaped by another percent sign.

```auto
       %<modifiers>{FRAME}
	      replaced	by the content of the FRAME frame in the selected
	      source tag; any frame writeable with the -w option can be used;
	      see COMPATIBILITY for more information.

```

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 4, 2024, 3:01pm UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/18 "2024-12-04T15:01:53Z")

</div>

As far as I understand it, you would not pass any tag content directly from Mp3tag to `id3.exe` using `%%{TXXX:SERIES}%%`

Using `%%{TXXX:SERIES}%%` as parameter in Mp3tag, you instruct `id3.exe` to copy the content of `TXXX:Series` by `id3.exe` itself - with its own tag reading code - and copy the read content into the one tag given after `-w` (as `-wTXXX:grouping`)

You would pass exactly this letters  
Parameter 1: -2  
Parameter 2: -wTXXX:grouping  
Parameter 3: "%{TXXX:SERIES}%"  
only the` "%_path%"` would be translated to  
Parameter 4: "C:\Temp\path\to\your\filename.mp3"

With this syntax, you would not need Mp3tag at all. You could directly execute the command in a CMD window.

With the suggested syntax in answer #14, the 3rd parameter "%SERIES%" will be translated from Mp3tag with the current content in SERIES and pass:  
Parameter 1: -2  
Parameter 2: -wTXXX:grouping  
Parameter 3: "Content of Tag SERIES"  
Parameter 4: "C:\Temp\path\to\your\filename.mp3"  
resulting in:  
id3.exe -2 -wTXXX:grouping "Content of Tag SERIES" "C:\Temp\path\to\your\filename.mp3"

Of course you can use whatever syntax you need to achieve your goal.  
IMHO it's important to see the different values passed from Mp3tag using the different syntax.

---

<div class="post-metadata">

### Author: ![Cantello](https://community.mp3tag.de/user_avatar/community.mp3tag.de/cantello/32/7697_2.png) [@Cantello](https://community.mp3tag.de/u/Cantello)
#### Post date: [December 5, 2024, 11:20am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/19 "2024-12-05T11:20:13Z")

</div>

Thanks for the explanation, so far I did not even know that mp3tag can pass any more information along to the external tool except for those listed [here](https://docs.mp3tag.de/customization/options/tools/). That is even easier than instructing id3.exe to copy the series tag.

I am still debating if a bug report for audiobookshelf is prudent, seeing as the GRP1 tag is not really standard but only widely accepted.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 5, 2024, 11:36am UTC](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699/20 "2024-12-05T11:36:56Z")

</div>

> [@Cantello](#):
>
> seeing as the GRP1 tag is not really standard

At least they should not refuse to read it.  
Ideally, they should be able to cope with both: the user-defined TXXX field and the one using the id3 token.

[Next page](https://community.mp3tag.de/t/tools-difference-between-path-directory-debugging/66699.md?page=2)
