Hmm... long long time ago, I did prepare a VB script for to prepare the m3u files for my audio library.
All audio file paths are colected into a txt -file which then is read by script as input. Script scans all the folders given in input file and prepares the m3u files to selected location (current folder or each source folder).
A BATch file for to prepare the library structure and to call the Main script:
REM ---------------------------------------------
REM ----- M3U PLAYLIST MAKER v. 1.0 -----
REM ---------------------------------------------
REM
REM COPY THIS BATCH FILE AND SAVE AS name.BAT
REM
rem list all audio file types here
dir *.mp3 *.ape *.wma *.wav *.flac *.ogg *.m4a *.aif *.mka *.mpa *.mpc *.ofr *.tta *.sd2 *.aac *.mp4 *.mp2 *.vqf /S /B /OG >alltmp.txt
sort alltmp.txt >all.txt
cscript MakeM3U.vbs
del alltmp.txt
REM ----------------------------------------------
vb script:
' script starts ---------------------------------------------------------------------
Option Explicit
Dim objStream, objWrite
Dim strLine
Dim FSO
Dim toPath, toPathOpen, tmpPath
Dim strLength
Dim strAlbum, strArtist, whereTo
Dim plFileName
Dim posArtist, posAlbum
Const fName = "all.txt"
Const ForWriting = 2
Const TristateFalse = 0
Const TristateTrue = -1
Const TristateUseDefault = -2
Const ForReading = 1
whereTo = Left(UCase(InputBox("Do you want to place all created playlists into same folder (current) (Y/N) ?" & chr(10) & chr(10) & "Y = All playlists are located on folder the script is runned from" & chr(10) & "N = Playlist is located on Artist\Album\ -folder(s)")), 1)
select case whereTo
case "" 'cancel pressed
WScript.Quit (0)
case else 'something inputted --> make it Y or N
if whereTo <> "Y" and whereTo <> "N" then whereTo = "N"
end select
Set FSO = CreateObject("Scripting.FileSystemObject")
Set objStream = FSO.OpenTextFile(fName, ForReading, 1)
toPathOpen = "tmp"
plFileName = ""
toPath = ""
tmpPath = ""
Do While Not objStream.AtEndOfStream
strLine = objStream.ReadLine
strLength = Len(strLine)
toPath = Left(strLine, InStrRev(strLine, "\", strLength, 1))
posAlbum = InStrRev(toPath, "\", Len(toPath)-1, 1)+1
posArtist = InStrRev(toPath, "\", posAlbum-2, 1)+1
plFileName = Mid(toPath, posArtist, posAlbum-posArtist-1) & "-" & Mid(toPath, posAlbum, len(toPath) - posAlbum) & ".m3u"
if strLength and (Len(toPath) < strLength) then
if toPath <> toPathOpen then
if toPathOpen <> "tmp" then objWrite.Close
tmpPath = toPath
if whereTo = "Y" then
toPath = FSO.GetAbsolutePathName (".") & "\"
end if
Set objWrite = FSO.OpenTextFile(toPath & plFileName, ForWriting, True, TristateUseDefault)
toPath = tmpPath
tmpPath = ""
end if
objWrite.WriteLine strLine
end if
toPathOpen = toPath
Loop
objWrite.Close
objStream.Close
MsgBox "Playlists been processed."
WScript.Quit(0)
' script ends ------------------------------------------------------------------------
IIRC, this script and batch worked on W2000/XP but I have not tried it on Vista/W7/W8 systems (maybe some changes needs to be made in VBScript).