Method: GetAbsolutePathName for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: GetAbsolutePathName for FileSystemObject
Method: GetAbsolutePathName for FileSystemObject
Returns a unique path.
sGetAbsolutePathName = Object.GetAbsolutePathName(Path)
| Object | FileSystemObject Object with this method |
| Path | String Specifies the absolute or relative path that DIAdem changes into a complete and unique path. |
| sGetAbsolutePathName | String 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\