# Autonumbering Wizard: Reset Counter for each new Discnumber

**URL:** https://community.mp3tag.de/t/autonumbering-wizard-reset-counter-for-each-new-discnumber/12096
**Category:** General Discussion
**Created:** [June 5, 2011, 9:20am UTC](https://community.mp3tag.de/t/autonumbering-wizard-reset-counter-for-each-new-discnumber/12096 "2011-06-05T09:20:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![spindizy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@spindizy](https://community.mp3tag.de/u/spindizy)
#### Post date: [June 5, 2011, 9:20am UTC](https://community.mp3tag.de/t/autonumbering-wizard-reset-counter-for-each-new-discnumber/12096/1 "2011-06-05T09:20:45Z")

</div>

There is a checkbox for to Reset Counter for each Directory, but there is no support to reset the counter on every new Discnumber.

An extra checkbox below the "Reset counter for each directory" with  
"Reset counter for each new discnumber"would be great! Easy to implement I suppose and a big help...

I store my collection in the "%discnumber%%tracknumber%" format, so not in seperate directories per disc. When tagging multi-disc I first set the discnumbers and it would be great if I can do the Tracknumbering automaticaly for all files in one time, and than do the next step, tag2filename also for all files in one time. But to use this, I need the reset checkbox for a new discnumber. Thanx in advance of course.

---

<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: [June 5, 2011, 1:16pm UTC](https://community.mp3tag.de/t/autonumbering-wizard-reset-counter-for-each-new-discnumber/12096/2 "2011-06-05T13:16:47Z")

</div>

> [@Spindizy](#):
>
> There is a checkbox for to Reset Counter for each Directory, but there is no support to reset the counter on every new Discnumber.

Yes, quite rightly so - I doubt that such a numbering assistant would really ease tagging.  
If you store tracks of different discs in one album and use a numbering assistant in which the change of one number superceeds another counter than this would cause havock.  
Using such an assistant would only lead to sensible results, if ...

- you have filled in the discnumber tag
- sorted the tracks by a dummy number

But then you probably wouldn't need the numbering assistant any more. If you do not sort by discnumber then the track number would be reset after a random number of tracks so that you end up with loads of equal track numbers which then would require another round by the numbering assistant.

THis can only be avoided if you have a hard criteria like the directory name..

What would be nice, though, would be a discnumber numbering assistant that could be reset by directory. So if the track numbering assistant would become a more general numbering assistant in which you could select which tag should be numbered (count by track vs. count by directory) this would be a nice modification.  
Still, even this assistant would lead to very strange results if you had tracks from different discs in one directory.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 5, 2011, 1:59pm UTC](https://community.mp3tag.de/t/autonumbering-wizard-reset-counter-for-each-new-discnumber/12096/3 "2011-06-05T13:59:24Z")

</div>

> [@Spindizy](#):
>
> There is a checkbox for to Reset Counter for each Directory, but there is no support to reset the counter on every new Discnumber.
> 
> An extra checkbox below the "Reset counter for each directory" with  
> "Reset counter for each new discnumber"would be great! Easy to implement I suppose and a big help...
> 
> I store my collection in the "%discnumber%%tracknumber%" format, so not in seperate directories per disc. When tagging multi-disc I first set the discnumbers and it would be great if I can do the Tracknumbering automaticaly for all files in one time, and than do the next step, tag2filename also for all files in one time. But to use this, I need the reset checkbox for a new discnumber. Thanx in advance of course.

There might be a trick to realize this wish, but when done it leave you alone with some empty folders, so you have to use an 'empty folder remove' tool additionally.

1. Select the files.

2. Move files into new sub folders. Run action.

Begin Action Group **Test\_2011#20110605.FormatTrackPerDiscnumber.1** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field:_ **\_FILENAME**  
_Formatstring:_ **%\_folderpath%%DISCNUMBER%'\<!--colorc--\>'%\_filename%**  
End Action Group **Test\_2011#20110605.FormatTrackPerDiscnumber.1** (1 Action)

 
1. Run Mp3tag "Autonumbering Wizard".

2. Move files back into home folder. Run action.

 Begin Action Group **Test\_2011#20110605.FormatTrackPerDiscnumber.2** 

Action #1  
_Actiontype 5:_ **Format value**  
_Field:_ **\_FILENAME**  
_Formatstring:_ **%\_folderpath%'..\<!--colorc--\>'%\_filename%**  
End Action Group **Test\_2011#20110605.FormatTrackPerDiscnumber.2** (1 Action)

 
1. Remove empty folders. Run action

 Begin Action Group **Test\_2011#20110605.FormatTrackPerDiscnumber.3** 

Action #1  
_Actiontype 15:_ **Export**  
_Select script filename:_ **Export CMD RemoveEmptyFolder**  
_Export filename:_ **$getEnv('USERPROFILE')'\Desktop\Mp3tag.RemoveEmptyFolder.cmd'**

 [\_] Append data [\_] One file per folder 

End Action Group **Test\_2011#20110605.FormatTrackPerDiscnumber.3** (1 Action)

 
1. Execute the CMD file ...  
"%USERPROFILE%\Desktop\Mp3tag.RemoveEmptyFolder.cmd"

 

This is the helper MTE script "Export CMD RemoveEmptyFolder.mte", which creates the CMD file ...  
_Export\_CMD\_RemoveEmptyFolder.mte ( 238bytes ) Number of downloads: 65 (until 2012-11-10)_

 

_In this thread's post #4 user M\_Mirza pointed out, that there was a little carelessness in the mte script, but crucial for the removing of the temporary folders.  
Folderpath names, which have space characters included must be enclosed in double quotes when used as a parameter for commandline functions._

 

Revised script ...

 **1: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.RemoveEmptyFolder.cmd',ANSI)** 

**2: '@ECHO OFF'  
3: $loop(%\_folderpath%%DISCNUMBER%,1)  
4: 'ECHO.Removing ... '%\_folderpath%%DISCNUMBER%  
5: 'RD "'%\_folderpath%%DISCNUMBER%'"'  
6: $loopend()  
7: 'PAUSE'  
8: 'DEL %0'**

 

[Export\_CMD\_RemoveEmptyFolder.mte](https://community.mp3tag.de/uploads/default/original/2X/6/6aaca63e0a37a09e3790d3869a52385786c906f5.mte) (242 Bytes)

 

DD.20110605.1833.CEST  
Edit.DD.20121110.0755.CET

 

[Export\_CMD\_RemoveEmptyFolder.mte](https://community.mp3tag.de/uploads/default/original/2X/6/6aaca63e0a37a09e3790d3869a52385786c906f5.mte) (242 Bytes)

---

<div class="post-metadata">

### Author: ![M\_Mirza](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bb73d2/32.png) [@M\_Mirza](https://community.mp3tag.de/u/M_Mirza)
#### Post date: [November 9, 2012, 9:11pm UTC](https://community.mp3tag.de/t/autonumbering-wizard-reset-counter-for-each-new-discnumber/12096/4 "2012-11-09T21:11:20Z")

</div>

I want to thank DetlevD for the very clever workaround above.

Also - a (very) minor adjustment to the MTE script. The line:

'RD '%\_folderpath%%DISCNUMBER%

should change to:

'RD "'%\_folderpath%%DISCNUMBER%'"'

..for obvious reasons. Atleast, for Windows 7 - I'm not sure about other operating systems.

Once again, I really appreciate your efforts.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [November 10, 2012, 6:10am UTC](https://community.mp3tag.de/t/autonumbering-wizard-reset-counter-for-each-new-discnumber/12096/5 "2012-11-10T06:10:38Z")

</div>

> [@M\_Mirza](#):
>
> I want to thank DetlevD for the very clever workaround above. Also - a (very) minor adjustment to the MTE script. ...

M\_Mirza, you are one out of 65 downloaders and of millions of unknown readers, thank you for your courageousness reporting this error!  
I have revised the forum post #3.

DD.20121110.0807.CET
