Search code examples
sharepointmoss

Get Directory Path to 12 Hive programmatically


Is there any way to get the directory path of the 12 Hive programmatically? I am creating a feature which delivers a file to the XML directory in the 12 hive, and I don't want to hardcode the directory path in my code.

Is there any Object Model property which exposes the 12 Hive directory path string as a property?


Solution

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