IADsPathname interface (iads.h)

The IADsPathname interface parses the X.500 and Windows path in ADSI.

The IADsPathname interface can be used to:

  • Set and get paths of ADSI objects in different formats.
  • Extract or add each element for a given ADsPath.
  • Construct ADsPaths to be used in queries of directory objects.
The IADsPathname interface is implemented on a Pathname object. You must instantiate the Pathname object to use the methods defined in the IADsPathname interface. This requirement is similar to calling the CoCreateInstance() function in C++.
IADsPathname *pPathname=NULL;
hr = CoCreateInstance(CLSID_Pathname,

You can also invoke the New operator in Visual Basic:

Dim path As New Pathname

Or use the CreateObject function in VBScript, supplying "Pathname" as the ProgID.

Dim path
Set path = CreateObject("Pathname")

The IADsPathname interface uses two enumeration types: ADS_SETTYPE_ENUM, and ADS_FORMAT_ENUM.


The IADsPathname interface inherits from the IDispatch interface. IADsPathname also has these types of members:


The IADsPathname interface has these methods.

Method Description
IADsPathname::AddLeafElement Adds an element to the end of the directory path already set on the Pathname object.
IADsPathname::CopyPath Creates a copy of the Pathname object.
IADsPathname::GetElement Retrieves an element of a directory path.
IADsPathname::GetEscapedElement Used to escape special characters in the input path.
IADsPathname::GetNumElements Retrieves the number of elements in the path.
IADsPathname::RemoveLeafElement Removes the last element from the directory path that has been set on the Pathname object.
IADsPathname::Retrieve The IADsPathname::Retrieve method retrieves the path of the object with different format types.
IADsPathname::Set Sets up the Pathname object for parsing a directory path.
IADsPathname::SetDisplayType Specifies how to display the path of an object.


Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header iads.h

See also




IADsPathname Property Methods