29 January, 2015

creating m3u playlist automatically

Hi,

I'm updating my USB stick very frequently and the new car I got does not allow folder browsing only playlists. - very annoying.

But, this is not something that will stop me... after a lot of testing a created the following script, it will create a M3U file in each sub-directory (for now it only works with one level down).

So, there is PlayListCreator-Step1.cmd:
==========================================
del *.m3u /S /Q
dir /B /AD >DirList.txt

for /f "tokens=*" %%A in (DirList.txt) do (PlayListCreator-Step2.cmd "%%A")
==========================================

And PlayListCreator-Step2.cmd:
==========================================
set root=%__CD__%
cd %1
dir /b /o:n *.mp3 > "%~1.m3u"
cd /d %root%
==========================================

Just save the content between the === to files and run PlayListCreator-Step1.cmd.


Enjoy...