Rob,
here is the code for you to create both the mp3.txt if you need it and audiolist.xml from within vb, no batch file required, the way it is set up at the moment it creates both file in the folder where the mp3s are located, but his is esay to change if you keep you audiolist elsewhere
goes at the top under Option ExpicitVB Code:
Declare Sub Sleep Lib "kernel32.dll" ( _ ByVal dwMilliseconds As Long)
you can put this code into a button click or cal it from a button clickVB Code:
Private Sub writexml() Dim f1 As Integer, songpath As String, mp3path As String, f2 As Integer, i As Integer mp3path = "C:\Documents and Settings\User1\My Documents\My Music\MP3\The Greatest Oldies (vol 1)\" f2 = FreeFile Open mp3path & "mp3.txt" For Output As #f2 ' if you don't need mp3.txt take out f1 = FreeFile Open mp3path & "audiolist.xml" For Output As #f1 Print #f1, "<?xml version=""1.0""?>" Print #f1, "<songs>" songname = Dir(mp3path & "\*.mp3") ' get first track i = 1 While Not Len(songname) = 0 songpath = "<song path=""" & mp3path & songname & """ title=""" & songname & """/> " Print #f1, songpath Print #f2, songname ' for mp3.txt Sleep 100 ' slight pause, needed songname = Dir ' get next track Wend Print #f1, "</songs>" Close End Sub
hope this helps to you to progress in VB
rgds p.




Reply With Quote