Data Type: FileSystemObject object
A FileSystemObject object.
Data Type: String
A path specifier.
Returns the filename element of a given path.
If the filename can’t be determined from the given
Path, a zero-length string (” “) is
Path can be a relative or
GetFileName doesn’t verify that a given file exists in
Path can be a network drive or
Like all the Getx Name methods of the
FileSystemObject object, the GetFileName method is more a string
manipulation routine that an object-related routine. GetFileName
has no built-in intelligence (and, in fact, seems to have even
less intelligence than usual for this set of methods); it simply
assumes that the last element of the string that is not part of
a drive and path specifier is in fact a filename. For example,
Path is C:\Windows, the method returns the
string “Windows”; if Path is C:\Windows\ (which unambiguously
denotes a folder rather than a filename), the method still
returns the string “Windows.”