# Command-line load of multiple directories

**URL:** https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860
**Category:** Support
**Created:** [September 24, 2010, 12:31pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860 "2010-09-24T12:31:34Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [September 24, 2010, 12:31pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/1 "2010-09-24T12:31:34Z")

</div>

How may I achive this please? With multiple /fp switches, only the last takes effect.

Thanks.

---

<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: [September 24, 2010, 3:15pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/2 "2010-09-24T15:15:28Z")

</div>

This works for me. Example, loading three folders (this is one commandline string):

"C:\Programme\Mp3tag\Mp3tag.exe" /fp "M:\MUSIK\ROCK\A" & "C:\Programme\Mp3tag\Mp3tag.exe" /fp "M:\MUSIK\ROCK\B" & "C:\Programme\Mp3tag\Mp3tag.exe" /fp "M:\MUSIK\SOUNDTRACK"

Note.  
Mp3tag ends up with the current working folder as the last imported folderpath.  
Regarding last example from above %\_workingpath% will contain "M:\MUSIK\SOUNDTRACK".  
It would be nice to have an additionally Mp3tag commandline option, which can set the current working folder to any user defined folderpath, independently from folders loaded by option "/fp".

It is also possible to create a textfile which contains the list of the folders to load and invoke a FOR command to load the folders from that list file.

FolderList.txt  
M:\MUSIK\ROCK\A  
M:\MUSIK\POP COLLECTION  
M:\MUSIK\SOUNDTRACK

FOR /F "tokens=\*" %A in (FolderList.txt) DO "C:\Programme\Mp3tag\Mp3tag.exe" /fp "%A"

DD.20100924.2046.CEST  
Edit.  
Commandline example changed.  
Added FOR example.  
DD.20100927.1752.CEST

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [September 25, 2010, 7:11pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/3 "2010-09-25T19:11:15Z")

</div>

> [@DetlevD](#):
>
> This works for me. Example, loading three folders (this is one commandline string):

Thanks D.

> [@DetlevD](#):
>
> I think it is more safe to use the folderpath without the trailing backslash when invoking Mp3tag.exe from the commandline.

Safe from... what?

> [@DetlevD](#):
>
> It would be nice to have an additionally Mp3tag commandline option, which can set the current working folder

Agreed!

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 5, 2010, 2:44pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/4 "2010-10-05T14:44:51Z")

</div>

Detlev, I fear this technique is unreliable. I just saw

> [@](#):
>
> start "Mp3tag Dance" "%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Dance"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Curtains"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Spacers"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Utility"

launch Mp3tag and load JUST the first directory. I have a horrible feeling the behaviour is timing sensitive.

I asked here before: what determines whether Mp3tag combines such commands into a multi-load and do not recall any answer. Anyone know?

---

<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: [October 5, 2010, 7:11pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/5 "2010-10-05T19:11:09Z")

</div>

> [@chrisjj](#):
>
> ... Mp3tag and load JUST the first directory. I have a horrible feeling the behaviour is timing sensitive.  
> I asked here before: what determines whether Mp3tag combines such commands into a multi-load and do not recall any answer. Anyone know?

This sounds not so good, and I do not know for sure what is going in in detail, but there might be more than one complication working together.

I think that a commandline driven Mp3tag.exe only can load (add) multiple folders by multiple invoking the Mp3tag.exe with parameter /fp when all this work is going on in the same process environment (shell) and Mp3tag.exe can detect for itself if there is already a running instance of Mp3tag.exe around in the process list. So Mp3tag.exe uses new incoming /fp parameter values to _add_ folders, but immediately kills newly spawned Mp3tag.exe processes.

Did you try the FOR loop proposal from post above?

I do not understand why you start a new cmd process by invoking _start "Mp3tag Dance"_.  
You will not see the new title at a new command window because Mp3tag is a window application.

I have tried such command lines ...

1. This works for me:

2. This works _not_ for me:

3. This works for me:

As I said it above ... there seems to be a quirk when the commandline is evaluated by Mp3tag.  
See the spaces on the commandline and see the trailing backslashes at the folder names.

DD.20101005.2310.CEST

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 5, 2010, 8:13pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/6 "2010-10-05T20:13:37Z")

</div>

> I think that a commandline driven Mp3tag.exe only can load (add) multiple folders by multiple  
> invoking the Mp3tag.exe with parameter /fp when all this work is going on in the same process  
> environment (shell) and Mp3tag.exe can detect for itself if there is already a running instance of  
> Mp3tag.exe around in the process list.

Florian??

> Did you try the FOR loop proposal from post above?

Yes, with path adjustment and in batch file:

```
echo > FolderList.txt
echo R:\Curtains >> FolderList.txt
echo R:\Dance >> FolderList.txt
echo R:\Spacers >> FolderList.txt
echo R:\Utility >> FolderList.txt

FOR /F "tokens=*" %%A in (FolderList.txt) DO "%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp "%%A"Success 5 of 5 times. Likewise with the folder order reversed.

```

But as I said, my test case is unstable.

> I do not understand why you start a new cmd process by invoking _start "Mp3tag Dance"_.

A remnant, indeed now redundant.

> 1. This works for me:
> 2. This works _not_ for me:

differing only in spaces - ouch!

> 1. This works for me:

OK, recoding:

```
REM recoded with no trailing path slash 
start "" "%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Dance"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Curtains"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Spacers"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Utility"

```

Result: Run 1 of 1 - FAILED to load Spacers and Utility

Then:

```
REM recoded sorting folders in increasing size
start "" "%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Spacers"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Utility"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Dance"&"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fp:"R:\Curtains"

```

Result: REM Run 1 of 1 - SUCCESS

I'll go with your unfailed-so-far FOR solution for now. But I am rather uncomfortable.

Thanks D.

---

<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: [October 5, 2010, 9:06pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/7 "2010-10-05T21:06:06Z")

</div>

> [@chrisjj](#):
>
> ... I'll go with your unfailed-so-far FOR solution for now. But I am rather uncomfortable. Thanks D.

If you do not have the need for an external text file, then try the attached "drag and drop" cmd script.  
[Mp3tag\_Folder\_Launcher.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/1/1270c6bc3f1e56fb7b5b5d10f95411c42540e8cb.txt) (836 Bytes)  
(for usage remove ".txt" extension)

DD.20101006.0203.CEST

[Mp3tag\_Folder\_Launcher.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/1/1270c6bc3f1e56fb7b5b5d10f95411c42540e8cb.txt) (836 Bytes)

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [October 5, 2010, 9:13pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/8 "2010-10-05T21:13:29Z")

</div>

If you can make a FolderList.txt file then just make it a FolderList.m3u and load that.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 5, 2010, 9:48pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/9 "2010-10-05T21:48:45Z")

</div>

Thanks D for that script.

> [@dano](#):
>
> If you can make a FolderList.txt file then just make it a FolderList.m3u

Of illegal format, I note. I feel unhappy relying on yet another undefined behaviour, especially one not supported by reliance from Mp3tag itself. Though this one does have the advantage of setting the CWD uniformly. Thanks Dano.

Perhaps Florian would care to make this behaviour offically defined?? (For Mp3tag - not .M3U generally of course.)

Meanwhile I think I'll take this inefficient but safest solution:

```
cd R:\
R:
echo rem > FolderList.m3u

FOR /R R:\Spacers %%G IN (*.*) DO echo %%G >> FolderList.m3u
FOR /R R:\Utility %%G IN (*.*) DO echo %%G >> FolderList.m3u
rem FOR /R R:\Dance %%G IN (*.*) DO echo %%G >> FolderList.m3u
rem FOR /R R:\Curtains %%G IN (*.*) DO echo %%G >> FolderList.m3u

"%PROGRAMFILES%\Mp3tag\Mp3tag.exe" /fn FolderList.m3u

```

The Mp3tag CWD is the DOS CWD.

---

<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: [October 5, 2010, 11:48pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/10 "2010-10-05T23:48:44Z")

</div>

> [@chrisjj](#):
>
> ...The Mp3tag CWD is the DOS CWD.

This sounds good and it seems that you have found a way to handle your needs.

In the meantime I have created two command scripts, which might be useful too.  
Please have a look into.

To create a text listfile of filepathes and/or folderpathes per "Drag and Drop" you can use the attached command file "Make Listfile of Files and Folders.cmd". Simply "Drag and Drop" selected files and/or folders onto the icon of the command script.  
[Make\_Listfile\_of\_Files\_and\_Folders.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/9/95737d1d603f676deebe7110f06de70530e10533.txt) (1.46 KB)

To launch Mp3tag using the previously created listfile you can use the attached command file "Mp3tag Listfile Launcher.cmd". Simply "Drag and Drop" the listfile onto the icon of the command script and Mp3tag will start and load all entries.  
[Mp3tag\_Listfile\_Launcher.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/5/5630bad34ec71e21d7fcafb9cb45e4f1df211c77.txt) (1.11 KB)

DD.20101006.0340.CEST

[Make\_Listfile\_of\_Files\_and\_Folders.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/9/95737d1d603f676deebe7110f06de70530e10533.txt) (1.46 KB)

[Mp3tag\_Listfile\_Launcher.cmd.txt](https://community.mp3tag.de/uploads/default/original/2X/5/5630bad34ec71e21d7fcafb9cb45e4f1df211c77.txt) (1.11 KB)

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [October 6, 2010, 9:39am UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/11 "2010-10-06T09:39:54Z")

</div>

> [@](#):
>
> I feel unhappy relying on yet another undefined behaviour, especially one not supported by reliance from Mp3tag itself.

The Mp3tag shell extension also relies on this functionality, no need to feel unhappy.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 6, 2010, 10:06am UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/12 "2010-10-06T10:06:20Z")

</div>

> [@dano](#):
>
> The Mp3tag shell extension also relies on this functionality, no need to feel unhappy.

Thanks Dano, but re changing that FolderList.txt to FolderList.m3u, I don't see reliance on the functionality of folderpath in M3U, so please clarify what you mean by "this functionality".

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [October 6, 2010, 10:22am UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/13 "2010-10-06T10:22:55Z")

</div>

The shell extension creates a temp m3u8 file and loads it (with folder paths in if necessary).

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 6, 2010, 10:59am UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/14 "2010-10-06T10:59:47Z")

</div>

Ah, I now see this is new in the latest version, which due to filter incompatibilty I have not yet adopted. 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: [October 6, 2010, 2:57pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/15 "2010-10-06T14:57:47Z")

</div>

Gread idea, DetlevD!

Just a little addition: If you have installed your Mp3tag.exe in  
C:\Programme (x86)...... on a 64bit-Windows 7, then you could use the environment value %ProgramFiles(x86)% instead of %ProgramFiles% in the commandline-script to point to the right place for Mp3tag.exe

Mp3tag.exe is still a 32bit application, right? 😉

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 6, 2010, 5:09pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/16 "2010-10-06T17:09:39Z")

</div>

> [@LyricsLover](#):
>
> If you have installed your Mp3tag.exe in  
> C:\Programme (x86)...... on a 64bit-Windows 7, then you could use the environment value %ProgramFiles(x86)% instead of %ProgramFiles%

I would be interest to know the advantage. Does installing Mp3tag in %ProgramFiles% not work? And is there no config that reaches both program types?

---

<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: [October 6, 2010, 6:38pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/17 "2010-10-06T18:38:43Z")

</div>

> [@chrisjj](#):
>
> I would be interest to know the advantage. Does installing Mp3tag in %ProgramFiles% not work? And is there no config that reaches both program types?

I think ... since Mp3tag.exe is still a 32-bit-application it will be automatically installed into the fitting branch for oldish programs. The leading part of the actual install folderpath can be evaluted from the environment variable "%ProgramFiles(x86)%".  
Doing so the Win7 system knows how to redirect system calls and much more specific things to handle the differences between the 32 and 64 bit worlds.

DD.20101006.2237.CEST

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [October 6, 2010, 7:11pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/18 "2010-10-06T19:11:09Z")

</div>

> Doing so the Win7 system knows how to redirect system calls  
> and much more specific things ...

But is there a pathspec that reaches both? If there is no pathspec to Mp3tag exe that will work an all systems...

Hence my: Does installing Mp3tag in %ProgramFiles% not work?

---

<div class="post-metadata">

### Author: ![Butzenbrecher](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/82dd89/32.png) [@Butzenbrecher](https://community.mp3tag.de/u/Butzenbrecher)
#### Post date: [October 6, 2010, 8:21pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/19 "2010-10-06T20:21:27Z")

</div>

> [@chrisjj](#):
>
> But is there a pathspec that reaches both?

don't know but with this command:

mklink /j Mp3tag "C:\Program Files (x86)\Mp3tag"

you can create a junction in the program files directory of a win 7 64-bit system that points to the right install location of mp3tag. Attention! Administrator rights required! So it's possible to use the scripts on all systems. It can be also usefull to have only one tools.ini for all systems.

Greetings!  
Knabbakeks

---

<div class="post-metadata">

### Author: ![jmthomas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/dfb087/32.png) [@jmthomas](https://community.mp3tag.de/u/jmthomas)
#### Post date: [February 12, 2011, 9:08pm UTC](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860/20 "2011-02-12T21:08:24Z")

</div>

> [@DetlevD](#):
>
> This sounds not so good, and I do not know for sure what is going in in detail, but there might be more than one complication working together.
> 
> I think that a commandline driven Mp3tag.exe only can load (add) multiple folders by multiple invoking the Mp3tag.exe with parameter /fp when all this work is going on in the same process environment (shell) and Mp3tag.exe can detect for itself if there is already a running instance of Mp3tag.exe around in the process list. So Mp3tag.exe uses new incoming /fp parameter values to _add_ folders, but immediately kills newly spawned Mp3tag.exe processes.
> 
> Did you try the FOR loop proposal from post above?
> 
> I do not understand why you start a new cmd process by invoking _start "Mp3tag Dance"_.  
> You will not see the new title at a new command window because Mp3tag is a window application.
> 
> I have tried such command lines ...
> 
> 1. This works for me:
> 
> 2. This works _not_ for me:
> 
> 3. This works for me:
> 
> As I said it above ... there seems to be a quirk when the commandline is evaluated by Mp3tag.  
> See the spaces on the commandline and see the trailing backslashes at the folder names.
> 
> DD.20101005.2310.CEST

For what it's worth...

The ampersands are getting tweaked by the command line processor, a know problem/bug/feature of the Micro$oft cmd.exe.

If you don't want to fight it, try installing a replacement command processor like TCC/LE from [jpsoft.com](http://jpsoft.com). If you remember 4DOS and 4NT, they are ancestors of TCC.

[Next page](https://community.mp3tag.de/t/command-line-load-of-multiple-directories/10860.md?page=2)
