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
VB Code:
Declare Sub Sleep Lib "kernel32.dll" ( _
ByVal dwMilliseconds As Long)
goes at the top under Option Expicit
VB Code:
Private Sub writexml()
Dim f1 As Integer, songpath As String, mp3path As String, f2 As Integer, i As Integer
thanks but would this automatically add the mp3 files to the xml doc when they have been copied into the my_mp3 folder or will it have to be manually updated by users. The reason I was using the batch was it made it simple for users to add their own tracks without having to manually edit the xml doc therselves.
eg user browses for a file and that is added to the my_mp3s folder and then ran the batch file and it was ready for playing
this code creates 2 files in the folder where mp3s are located,at present it is a folder on my hard drive, so you will need to change that. or select it from a common dialog setting mp3path to that.
i didn't know if you needed mp3.txt or if it was just part of your process, it is not required for this code
this code does not copy any files, it just creates the files with contents as your batch file did.
if you wanted to copy files you would do that first, then run this code with the path set to where you have copied them to.
if you just copy this into a new project and put a cmdbutton on the form you can test it quite easily
I have this in my general declarations but I receive this error -
compile error:
constants,Fixed-length strings,arrays,user-defined types and Declare statements not allowed as public members of object modules.
sorry can't open your file, but the message is specific, one of the variables needs to be dimmed, i just checked my code, all the variable in it were declared,
did you add any??
if you want me to check your file attach it in a zip
p.