# Count number of folders in parent directory?

**URL:** https://community.mp3tag.de/t/count-number-of-folders-in-parent-directory/16962
**Category:** Support
**Created:** [June 12, 2015, 11:17pm UTC](https://community.mp3tag.de/t/count-number-of-folders-in-parent-directory/16962 "2015-06-12T23:17:10Z")
**Posts on this page:** 1
**Showing post:** 2

<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 13, 2015, 5:47am UTC](https://community.mp3tag.de/t/count-number-of-folders-in-parent-directory/16962/2 "2015-06-13T05:47:07Z")

</div>

> [@Guillaume](#):
>
> ... Is there a way to count the number of folders present in the parent directory? ...

There is no proper way in the interactive interface of Mp3tag, but you may create an export script, which can count the folders, like this example script ...

**1: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Export.txt',UTF-8)** 

**2: $loop($folderdepth(%\_folderpath%))  
3: 'Folderdepth: '$folderdepth(%\_folderpath%)  
4: $loop(%\_directory%,1)  
5: %\_parent\_directory%'|'%\_directory%  
6: $loopend()  
7: 'Folder count: '%\_max\_counter%  
8: $loopend()  
9: 'Folderpath count: '%\_max\_counter%**

 

DD.20150613.0947.CEST

 

You may check out the method there ...  
[/t/12767/1](https://community.mp3tag.de/t/12767/1)

 

DD.20150613.1033.CEST

---

_[View the full topic](https://community.mp3tag.de/t/count-number-of-folders-in-parent-directory/16962)._
