DIAdem Help

Method: GetAbsolutePathName for FileSystemObject

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

Method: GetAbsolutePathName for FileSystemObject

Returns a unique path.

sGetAbsolutePathName = Object.GetAbsolutePathName(Path)
ObjectFileSystemObject
Object with this method
PathString
Specifies the absolute or relative path that DIAdem changes into a complete and unique path.
sGetAbsolutePathNameString
Receives the absolute path. The absolute path only includes a \ character at the end if it is the root folder of the drive.

The following example specifies the absolute path. The assumption is that C:\Program Files\DIAdem is the current folder:

Function GetAbsolutePath(sPath)
  Dim fso
  Set fso = CreateObject("Scripting.FileSystemObject")
  GetAbsolutePath = fso.GetAbsolutePathName(sPath)
End Function

Call MsgBox(GetAbsolutePath("c:"))                         'Returns C:\Program Files\DIAdem
Call MsgBox(GetAbsolutePath("c:.."))                       'Returns C:\Program Files
Call MsgBox(GetAbsolutePath("c:\"))                        'Returns C:\
Call MsgBox(GetAbsolutePath("c:*.*\test"))                 'Returns C:\Program Files\DIAdem\*.*\test
Call MsgBox(GetAbsolutePath("test"))                       'Returns C:\Program Files\DIAdem\test
Call MsgBox(GetAbsolutePath("c:\..\..\test"))              'Returns C:\test
Call MsgBox(GetAbsolutePath("C:\Program Files\DIAdem\..")) 'Returns C:\Program Files\

Log in to get a better experience