1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Option Explicit
Dim fso, rep, fd, dossier_source, dossier_cible, subFD, sName, tmp
dossier_source = "C:\Temp\"
dossier_cible = "C:\TMP\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fd = fso.GetFolder(dossier_source)
If fd.SubFolders.Count = 0 Then
MsgBox "Il n'y a aucun dossier dans le répertoire " & UCase(fd.Path)
WScript.Quit 0
End If
tmp = year(now) & "_" & Right("00" & Month(now),2) & "_" & Right("00" & day(now),2)
For each subFD In fd.SubFolders
sName = subFD.Name
Rep = InputBox("Le dossier actuel à déplacer est : " & UCase(sName),"Déplacement et renommage de dossiers",sName & "_" & tmp)
If rep = "" Then WScript.Quit 0
fso.MoveFolder subFD.Path, dossier_cible & Rep
Next |
Partager