Command-line load of multiple directories


#1

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

Thanks.


using foo_run to launch Mp3tag in Foobar2000
#2

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


#3

Thanks D.

Safe from... what?

Agreed!


#4

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

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?


#5

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:
    start "Mp3tag Dance" "Mp3tag.exe" /fp:"X:\AnyFolder1"&"Mp3tag.exe" /fp:"X:\AnyFolder2"&"Mp3tag.exe" /fp:"X:\AnyFolder3"&"Mp3tag.exe" /fp:"X:\AnyFolder4"

  2. This works not for me:
    start "Mp3tag Dance" "Mp3tag.exe" /fp:"X:\AnyFolder1" & "Mp3tag.exe" /fp:"X:\AnyFolder2" & "Mp3tag.exe" /fp:"X:\AnyFolder3" & "Mp3tag.exe" /fp:"X:\AnyFolder4"
    Mp3tag throws error windows of cannot access this or that folder.

  3. This works for me:
    start "Mp3tag Dance" "Mp3tag.exe" /fp:"X:\AnyFolder1" & "Mp3tag.exe" /fp:"X:\AnyFolder2" & "Mp3tag.exe" /fp:"X:\AnyFolder3" & "Mp3tag.exe" /fp:"X:\AnyFolder4"

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


#6

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.


#7

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 (836 Bytes)
(for usage remove ".txt" extension)

DD.20101006.0203.CEST

Mp3tag_Folder_Launcher.cmd.txt (836 Bytes)


Opening multiple files at once
#8

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


#9

Thanks D for that script.

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.


#10

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 (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 (1.11 KB)

DD.20101006.0340.CEST

Make_Listfile_of_Files_and_Folders.cmd.txt (1.46 KB)

Mp3tag_Listfile_Launcher.cmd.txt (1.11 KB)


Opening multiple files at once
FLAC Tags
#11

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


#12

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".


#13

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


#14

Ah, I now see this is new in the latest version, which due to filter incompatibilty I have not yet adopted. Thanks.


#15

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? :wink:


#16

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?


#17

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


#18

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?


#19

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


#20

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. If you remember 4DOS and 4NT, they are ancestors of TCC.