1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| Dim Rep 'Nom du répertoire à parcourir
Dim oFSO,oFl
Dim chemin
Dim copyto
Dim Nof
Dim AN
Dim UTF
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const ModeAscii = 0, ModeUnicode = -1
Dim texte
chemin = "C:\Documents and Settings\Ultradoux\Bureau\Nouveau dossier\test\"
Rep = "C:\Documents and Settings\Ultradoux\Bureau\Nouveau dossier"
Set oFSO = CreateObject("Scripting.FileSystemObject")
If oFSO.FolderExists(Rep) Then
For each oFl in oFSO.GetFolder(Rep).Files
if Right(oFl.Name,3)="m3u" Then
Nof = Left(oFl.Name, Len(oFl.Name) - 4) + ".spl"
copyto = chemin + Nof
Set AN = oFSO.OpenTextFile(oFl.Name, ForReading,, ModeAscii)
Set UTF = oFSO.OpenTextFile(copyto, ForWriting, true, ModeUnicode)
UTF.writeLine "SPL PLAYLIST"
UTF.writeLine "VERSION 1.00"
texte = AN.ReadAll
texte = right(texte, Len(texte)-7)
UTF.Write texte
With UTF
.writeLine ""
.writeLine ""
.writeLine "END PLAYLIST"
End With
End If
Next
End If |
Partager