I intend to write a little DOS batch that creates m3u files for a given subdirectory structure containing sound files. The m3u file shall have the name '[Parent Directory].m3u' (where [Parent Directory] is replaced by the actual name of the parent dicrectory, of course).
My batch so far:
FOR /D /R %%I IN (\*.\*) DO (
IF EXIST "%%I\\*.mp3" (
FOR %%* in ("%%I") do set X=%%~n*
DIR /B "%%I\\*.mp3" > "%%I\\%X%.m3u"
)
)
Well -- to put it short, it doesn't work as intended. The m3u files are created, but they have names like '.m3u' (Yepp, only the extension, no name at all).
The reason probably is that DOS does not allow to call a for loop within another for loop.
Hmmph -- is there any way to get the current directory name (and only the current one, not the whole path!) while working through an outer for loop?
Grateful thanks for any useful hint!