Hi all,
I have this code which works perfect but I just need help adjusting it slightly.

here is my code

VB Code:
  1. Private Sub Command2_Click()
  2. Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer, pos As Integer
  3.     Dim Artist As String, SongName As String, artname As String, fname As String, MyPath As String
  4.  
  5.     Dim mytag As Boolean
  6.    mp3path = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s\"
  7.    xmlpath = "C:\Program Files\mgamerz\XML PLAYER\"
  8.  
  9.  
  10.      
  11.      SongName = Dir(mp3path & "\*.mp3")
  12.      fname = mp3path & SongName
  13.      
  14.             With Form4
  15.    
  16.     While Not Len(SongName) = 0
  17.        
  18. '        Artist = GetMP3Tag(fname)
  19.                 If Not i = 0 Then
  20.                     Load .Label1(i): Load .Text1(i)
  21.                     .Label1(i).Top = .Label1(i - 1).Top + 350
  22.                     .Text1(i).Top = .Text1(i - 1).Top + 350
  23.                     .Label1(i).Visible = True: .Text1(i).Visible = True
  24.                    
  25.                 End If
  26.                
  27.                 .Label1(i) = SongName
  28.                 mytag = GetMP3Tag(fname)
  29.                 .Text1(i) = RTrim(MP3Info.sArtist)
  30.                      
  31.  
  32.         SongName = Dir
  33.              fname = mp3path & SongName
  34.  
  35.         i = i + 1
  36.    
  37.     Wend
  38.                 .Height = .Text1(.Text1.Count - 1).Top + 1600
  39.                 .TAG = mp3path
  40.                 MDIForm1.Caption = "Close This Form to Update XML Playlist"
  41.                 .Show
  42. '                .WindowState = 2
  43.             End With
  44.     TAG = "wait"
  45.     While TAG = "wait"
  46.     DoEvents
  47.     Wend
  48.    
  49.      
  50.    i = 1
  51.      f2 = FreeFile
  52.     Open mp3path & "mp3.txt" For Output As #f2
  53.      f1 = FreeFile
  54.      
  55.     Open xmlpath & "audiolist.xml" For Output As #f1
  56.    
  57.    
  58.     Print #f1, "<?xml version=""1.0""?>"
  59.     Print #f1, "<songs>"
  60.     SongName = Dir(mp3path & "\*.mp3")
  61.     i = 1
  62.     While Not Len(SongName) = 0
  63.        
  64.         ' if you can return the name of the artist you put the code in here
  65.  
  66.                mytag = GetMP3Tag(mp3path & SongName)
  67.              'pos = InStr(mytag, "\")
  68.              mytag = Replace(mytag, "\", "/")
  69. Do While InStr(mytag, " ")
  70.   mytag = Replace(mytag, " ", "")
  71. Loop
  72.  
  73.              Artist = RTrim(MP3Info.sArtist)
  74.              If Len(Artist) = 0 Then Artist = "UNKOWN"
  75.                  
  76.                  
  77.               MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath))) & " " & SongName
  78.        
  79.              MyPath = Replace(MyPath, "\", "/")
  80.              
  81.  
  82.            MyPath = Replace(MyPath, " ", "", 1, 1)
  83.        songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & SongName & """/> "
  84.        
  85.         Print #f1, songpath
  86.         Print #f2, SongName
  87.         Sleep 100
  88.         SongName = Dir
  89.    
  90.     Wend
  91.  
  92.     Print #f1, "</songs>"
  93. Close
  94.  
  95. End Sub
  96.  
  97. Private Sub Command3_Click()
  98.  
  99. Dim Q As String
  100. Q = "" & vbCrLf
  101. Q = Q + "Developed By" & vbCrLf
  102. Q = Q + "Rob Gibson, Tony Dockery 2005© " & vbCrLf
  103.  
  104.  
  105.  
  106. MsgBox Q, vbInformation, "XML Updater V2.0"
  107.  
  108. End Sub
  109.  
  110.  
  111. Private Sub Command4_Click()
  112. End
  113. End Sub
  114.  
  115. Private Sub Command5_Click()
  116.  
  117. Dim strFile() As String, strPath As String
  118.     Dim n As Long, nCount As Long
  119.     On Error Resume Next
  120.     With CommonDialog1
  121.    
  122.         .Flags = cdlOFNAllowMultiselect + cdlOFNExplorer
  123.         .CancelError = True
  124.         .InitDir = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s"
  125.         .DialogTitle = "Select File To Delete"
  126.                                                              
  127.        .ShowOpen
  128.         If Err.Number <> cdlCancel Then
  129.             strFile = Split(.FileName, vbNullChar)
  130.             nCount = UBound(strFile)
  131.             If nCount = 0 Then
  132.                 'Only one file is selected so split up the path and the filename
  133.                 ReDim strFile(1)
  134.                 strFile(0) = Left$(.FileName, InStrRev(.FileName, "\"))
  135.                 strFile(1) = Mid$(.FileName, InStrRev(.FileName, "\") + 1)
  136.                 nCount = 1
  137.             End If
  138.             strPath = strFile(0)
  139.             If Right$(strPath, 1) <> "\" Then
  140.                 strPath = strPath & "\"
  141.             End If
  142.             For n = 1 To nCount
  143.                     Kill strPath & strFile(n)
  144.            
  145.             Next
  146.         End If
  147.     End With
  148. End Sub

It displays the xml file like so

<?xml version="1.0"?>
<songs>
<song path="my_mp3s/Coldplay - Trouble.mp3" artist="Coldplay" title="Coldplay - Trouble.mp3"/>
</songs>

I would like it to not display the .mp3 in the title like below

<?xml version="1.0"?>
<songs>
<song path="my_mp3s/Coldplay - Trouble.mp3" artist="Coldplay" title="Coldplay - Trouble"/>
</songs>

Sorry to bother you all again
Thanks
Rob