O'Reilly logo

VBScript in a Nutshell, 2nd Edition by Ron Petrusha, Matt Childs, Paul Lomax

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

FileSystemObject.GetAbsolutePathName Method

Syntax

                  oFileSysObj.GetAbsolutePathName(Path)
oFileSysObj

Use: Required

Data Type: FileSystemObject object

A FileSystemObject object.

Path

Use: Required

Data Type: String

A path specifier.

Return Value

A string containing the absolute path of a given path specifier.

Description

Converts a relative path to a fully qualified path, including the drive letter.

Rules at a Glance

  • (.) returns the drive letter and complete path of the current folder.

  • (..) returns the drive letter and path of the parent of the current folder.

  • If Path is simply a filename without a path, the method concatenates the complete path to the current directory with the filename. For example, if the current folder is C:\Documents\MyScripts, then the method call:

    sFileName = GetAbsolutePathName("MyFile.txt")

    produces the string “C:\Documents\MyScripts\MyFile.txt”.

  • All relative pathnames are assumed to originate at the current folder. This means, for example, that (.) returns the drive letter and complete path of the current folder, and that (..) returns the drive letter and path of the parent of the current folder.

  • If a drive isn’t explicitly provided as part of Path, it’s assumed to be the current drive.

  • Wildcard characters can be included in Path at any point.

Programming Tips and Gotchas

  • An absolute path provides a complete route from the root directory of a particular drive to a particular folder or file. In contrast, a relative path describes a route from the current folder to a particular ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required