1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Title = "Smart Folder Creator"
RootFolder = "E:\Batch\Developpez\VEHICULES"
Matricule = InputBox("Veuillez saisir le numero de la plaque d'immatriculation",Title,"456KL35")
CG = Matricule & "\CARTE GRISE"
CTCH = Matricule & "\CONTROLE TECHNIQUE"
Archive = CTCH &"\ARCHIVE CONTROLE TECHNIQUE"
PHOTO = Matricule & "\PHOTO"
SubFolders = Array(CG,CTCH,PHOTO,Archive)
For Each SubFolder in SubFolders
Call SmartCreateFolder(RootFolder & "\" & SubFolder)
Next
'------------------------------------------------
Sub SmartCreateFolder(strFolder)
With CreateObject("Scripting.FileSystemObject")
If Not .FolderExists(strFolder) then
SmartCreateFolder(.getparentfoldername(strFolder))
.CreateFolder(strFolder)
End If
End With
End Sub
'------------------------------------------------ |
Partager