DIAdem Help

Method: GetFileName for FileSystemObject

  • Updated2024-09-12
  • 1 minute(s) read

Method: GetFileName for FileSystemObject

Returns the part of the path that corresponds with the name of a file or a folder.

sGetFileName = Object.GetFileName(Path)
ObjectFileSystemObject
Object with this method
PathString
Specifies the path. The path must neither correspond with an existing folder nor with an existing file.
sGetFileNameString
Receives the filename or the folder name.

The following example specifies the filename or the folder name in a path:

Function GetName(sDrive)
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  GetName = fso.GetFileName(sDrive)
End Function

See Also

Objects Overview

Log in to get a better experience