Method: GetParentFolderName for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: GetParentFolderName for FileSystemObject
Method: GetParentFolderName for FileSystemObject
Returns the name of the superordinate folder for a file or a folder.
sGetParentFolderName = Object.GetParentFolderName(Path)
| Object | FileSystemObject Object with this method |
| Path | String Specifies the path of the folder or the file, of which DIAdem specifies the superordinate folder. The path must neither correspond with an existing folder nor with an existing file. |
| sGetParentFolderName | String Receives the name of the superordinate folder. If no superordinate folder exists, DIAdem returns an empty string. |
The following example returns the name of the superordinate folder.
Function ParentName(sDriveSpec) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") ParentName = fso.GetParentFolderName(sDriveSpec) End Function