Method: GetBaseName for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: GetBaseName for FileSystemObject
Method: GetBaseName for FileSystemObject
Returns the part of the path that corresponds with the filename of a file without filename extension.
sGetBaseName = Object.GetBaseName(Path)
| Object | FileSystemObject Object with this method |
| Path | String Specifies the path. The path must not correspond with an existing file. |
| sGetBaseName | String Receives the filename. |
The following example specifies the filename in a path:
Function GetName(sFile) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") GetName = fso.GetBaseName(sFile) End Function