FileSystemObject.GetBaseName Method (VB6) |
Yes
oFileSysObj.GetBaseName(Path)
oFileSysObj
Use: Required
Data Type: FileSystemObject object
Any object variable returning a FileSystemObject object.
Path
Use: Required
Data Type: String
A path specifier.
A string containing the last element in Path.
Returns the name of the last path component, less any extension.
The file extension of the last element in Path isn't included in the returned string.
GetBaseName doesn't verify that a given file or folder exists in Path.
In stripping the "file extension" and returning the base name of Path, GetBaseName has no intelligence. That is, it doesn't know whether the last component of Path is a path or a filename. If the last component includes one or more dots, it simply removes the last one, along with any following text. Hence, GetBaseName returns a null string for a Path of "." and it returns "." for a Path of "..". It is, in other words, really a string manipulation function, rather than a file function.