I've always found it difficult to remember where all the folders SharePoint uses are and what each folder is used for. So here's my attempt to consolidate this information in one post for easy reference. This post assumes default folder locations. Obviously if you customized anything, then you're on your own.

 

WSS/SharePoint Server Program Folder

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12

C:\Program Files\Microsoft Office Servers\12.0 (not sure about this)

This is where most of the program files for SharePoint live.

 

WSS/SharePoint Binaries

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN

This contains the executable binaries used with SharePoint. For example, stsadm.exe and the WSS Timer service, owstimer.exe, is located here.

 

WSS/SharePoint Server Assemblies, ASPX, ASMX

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI

Contains most of the ASPX (ASP.NET Web Forms) and ASMX (ASP.NET Web Services) files of SharePoint. Also if you are writing code that uses the SharePoint assemblies (ie. Microsoft.SharePoint.dll, Microsoft.SharePoint.Server.dll, ...), then the assemblies you need are located in this folder.

 

SharePoint Logs

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS

SharePoint told you to check the logs? This is where you can find the raw log files.

 

SharePoint Site Features

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES

Looks like this is where all the SharePoint Features metadata is stored.

 

Site Layout Template

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS

This is the folder where the virtualized _layouts path for each site URL is located. Add additional files in here to have it be available to all sites.

 

SharePoint Setup Cache

C:\Program Files\Common Files\Microsoft Shared\SERVER12\Server Setup Controller

Looks like this is where SharePoint Setup stores the setup configuration. If you have Office installed as well, then this folder is also used for them.

 

Web Application Virtual Directories

C:\Inetpub\wwwroot\wss\VirtualDirectories

The folder where your SharePoint web applications point to.

 

Web Application web.config

C:\Inetpub\wwwroot\wss\VirtualDirectories\[web application]\web.config

Need to customize the web.config for a particular web application? This is the web.config that you want to edit. Replace [web application] to your web application first of course.

 

Install Web Parts per Web Application in here

C:\Inetpub\wwwroot\wss\VirtualDirectories\[web application]\_app_bin

Additional assemblies (ie. custom web parts) are installed here on a per web application basis. You can also install Web Parts to the GAC as well to be accessible in all web applications on the server.

 

This post compliments my post on SharePoint 2007's registry locations.

If anyone knows of any other interesting folder locations, let me know so I can add them here.



Good Reply:
1.
decided to derive them

public static class SystemPaths
{
private static readonly string sharePointServerInstallPath;
private static readonly string sharePointServerInstallPathRoot;
private static readonly string wSSInstallPath;
private static readonly string wSSRegistryPath;
private static readonly string wSSSharePointBinaryPath;
private static readonly string sharePointRegistryPath;
private static readonly string wSSSharePointIsapiPath;
private static readonly string wSSSharePointLogsPath;
private static readonly string wSSSharePointFeaturesPath;
private static readonly string wSSSharePointLayoutsPath;


static SystemPaths()
{
wSSRegistryPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\";
sharePointRegistryPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0\";
string commonProgramFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles);

sharePointServerInstallPath = (string)Registry.GetValue(sharePointRegistryPath, "InstallPath", null);
sharePointServerInstallPathRoot = (string)Registry.GetValue(SharePointRegistryPath, "InstallPathRoot", null);
wSSInstallPath = string.Format(@"{0}\Microsoft Shared\web server extensions\12", commonProgramFilesPath);

wSSSharePointBinaryPath = Path.Combine(wSSInstallPath, "BIN");
wSSSharePointIsapiPath = Path.Combine(wSSInstallPath, "ISAPI");
wSSSharePointLogsPath = Path.Combine(wSSInstallPath, "LOGS");
wSSSharePointFeaturesPath = Path.Combine(wSSInstallPath, @"TEMPLATE\FEATURES");
wSSSharePointLayoutsPath = Path.Combine(wSSInstallPath, @"TEMPLATE\LAYOUTS");



}
/// <summary>
/// Gets the Office Sharepoint Server install path.
/// </summary>
/// <example>C:\Program Files\Microsoft Office Servers\12.0</example>
public static string SharePointServerInstallPath
{
get
{
return sharePointServerInstallPath;
}
}
/// <summary>
/// Gets the Office Sharepoint Server install path root.
/// </summary>
/// <example>C:\Program Files\Microsoft Office Servers\</example>
public static string SharePointServerInstallPathRoot
{
get
{
return sharePointServerInstallPathRoot;
}
}


/// <summary>
/// Gets tha path to the WSS install path root.
/// </summary>
/// <example>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12</example>
public static string WSSInstallPath
{
get
{
return wSSInstallPath;
}
}

/// <summary>
/// Gets the path to the root registry entry fo WSS.
/// </summary>
/// <example>HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\</example>
public static string WSSRegistryPath
{
get
{
return wSSRegistryPath;
}
}

/// <summary>
/// Gets the path to the root registry entry for Office Sharepoint Server.
/// </summary>
/// <example>HKLM\SOFTWARE\Microsoft\Office Server\12.0\</example>
public static string SharePointRegistryPath
{
get
{
return sharePointRegistryPath;
}
}

/// <summary>
/// Gets the path to the directory that contains executable binaries used with WSS and Office SharePoint Server.
/// </summary>
/// <remarks>stsadm.exe and the WSS Timer service, owstimer.exe, is located here.</remarks>
/// <example>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN</example>
public static string WSSSharePointBinaryPath
{
get
{
return wSSSharePointBinaryPath;
}
}
/// <summary>
/// Gets the path to the directory that contains the WSS and Office SharePoint Server Assemblies, ASPX, ASMX.
/// </summary>
/// <remarks>Contains most of the ASPX (ASP.NET Web Forms) and ASMX (ASP.NET Web Services) files of SharePoint. Also if you are writing code that uses the SharePoint assemblies (ie. Microsoft.SharePoint.dll, Microsoft.SharePoint.Server.dll, ...), then the assemblies you need are located in this folder.</remarks>
/// <example>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI</example>
public static string WSSSharePointISAPIPath
{
get
{
return wSSSharePointIsapiPath;
}
}
/// <summary>
/// Gets the path to the directory that contains the WSS and Office SharePoint Server log files.
/// </summary>
/// <remarks>SharePoint told you to check the logs? This is where you can find the raw log files.</remarks>
/// <example>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS</example>
public static string WSSSharePointLogsPath
{
get
{
return wSSSharePointLogsPath;
}
}
/// <summary>
/// Gets the path to the directory that contains the WSS and Office SharePoint Server Site Features.
/// </summary>
/// <remarks>Looks like this is where all the SharePoint Features metadata is stored.</remarks>
/// <example>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES</example>
public static string WSSSharePointFeaturesPath
{
get
{
return wSSSharePointFeaturesPath;
}
}

/// <summary>
/// Gets the path to the directory that contains the WSS and Office SharePoint Server Site Layouts.
/// </summary>
/// <remarks>This is the folder where the virtualized _layouts path for each site URL is located. Add additional files in here to have it be available to all sites.</remarks>
/// <example>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS</example>
public static string WSSSharePointLayoutsPath
{
get
{
return wSSSharePointLayoutsPath;
}
}
}


2.
Log folders path :SPDiagnosticsService.Local.LogLocation
or one more :Microsoft.SharePoint.Utilities.SPUtility.GetGenericSetupPath("LAYOUTS")