Name, propriété

Définit ou renvoie le nom d'un fichier ou dossier spécifié. Lecture/écriture.

object.Name [= newname]

Arguments

object

Correspond toujours au nom d'un objet File ou Folder.

newname

Facultatif. S'il est fourni, l'argument newname est le nouveau nom de l'object spécifié.

Notes

Le code suivant illustre l'emploi de la propriété Name :

Function ShowFileAccessInfo(filespec)
   Dim fso, f, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(filespec)
   s = f.Name & " sur le lecteur " & UCase(f.Drive) & "<BR>"
   s = s & "Créé le: " & f.DateCreated & "<BR>"
   s = s & "Dernier accès le: " & f.DateLastAccessed & "<BR>"
   s = s & "Dernière modification le: " & f.DateLastModified   
   ShowFileAccessInfo = s
End Function

Voir aussi

Attributes, propriété | DateCreated, propriété | DateLastAccessed, propriété | DateLastModified, propriété | Drive, propriété | Files, propriété | IsRootFolder, propriété | ParentFolder, propriété | Path, propriété | ShortName, propriété | ShortPath, propriété | Size, propriété | SubFolders, propriété | Type, propriété

Application: File, objet | Folder, objet