Get directory path to 12 hive programmatically

Is there a way to get the path to the 12 Hive directory programmatically? I am creating a function that delivers a file to an XML directory in 12 bushes, and I don’t want to hardcode the directory path in my code.

Is there any Object Model property that provides the 12 Hive directory path string as a property?

+4
source share
5 answers

You can use the Microsoft.SharePoint.Utilities.SPUtility.GetGenericSetupPath () method. See the WSS SDK for more details: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.getgenericsetuppath.aspx

+18
source

xml 12 ? , "". TEMPLATE\XML?

+2

- SharePoint, 12- , ? , Microsoft .

, MapPath "/_layouts", .

+1

32 64 , Program Files - c:\Program Files.

, c:\Program Files\Common Files. : System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonProgramFiles);

Then you can use this folder and then merge the rest of the elements ... I do not think that these elements are language specific.

0
source

I just want to add that if you use MapPath () in Sharepoint, you get a path that points to the website location, the default is "Inetpub", for example:

C: \ Inetpub \ Wwwroot \ WSS \ VirtualDirectories \ 12345 \ MyFolder

The path does not indicate a 12-bush.

0
source

All Articles