IADsFileShare Property: Path

Property Name
Path

Property Type
String

Description
Gets and sets the file system path to the shared directory. This is the local path on the host computer. The path can be set only when creating a file share. For an existing file share, the path is read-only.

Example:

Dim FileShare As IADsFileShare
'Get the FileShare interface for the file share "ShareName". The DomainName can be skipped if the computer does not belong to a particular domain
Set FileShare = GetObject ("NTDS://DomainName/ComputerName/file_services/ShareName")
'Print the path for the file share "ShareName"
Debug.Print FileShare.Path 
'An example of creating a share
Dim Container as IADsContainer
'Get the container for the top level file services object. Using a domain name in the GetObject speeds up the operation, but is not essential.
Set Container = GetObject("NTDS://ComputerName/file_services")
'Create the File Share object. The first parameter is "Share" which is the class name for File Shares.
Set FileShare = Container.Create("Share", "ShareName")
'Set the path to which this file share will point to. Setting the other IADsFileShare is recommended, but not mandatory
FileShare.Path = "C:\directory"
'Save this change. This effectively creates the file share.
FileShare.SetInfo

 

See Also