1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Dim oFSO,oFld
Set oFSO = CreateObject("Scripting.FileSystemObject")
MonDossier = "c:\test\"
For each oFl in oFSO.GetFolder(MonDossier).Files
NomDate = Mid(oFl.Name,5,6)
If Not oFSO.FolderExists(MonDossier & NomDate) Then
CreerDossier MonDossier & NomDate
End If
oFl.Move MonDossier & NomDate &"\test.txt"
Next
Function CreerDossier(Dossier)
Dim oFSO,oFld
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFld=oFSO.CreateFolder(Dossier)
Set oFSO = Nothing
End Function |
Partager