SharePoint Development - Quick Tips #1

For SharePoint developers, we will visit the "12" hive almost on a daily basis - to deploy features, check log files, deploy custom site definitions, etc. One old trick is to create an environment variable that short-cuts our way to the "12" hive (alternately, most of us would have a shortcut already created on the desktop or the explorer's quick launch).

From "My Computer", right-click and select "Properties" (or, "Win+Break" - another short-cut). From the "Advanced" tab, select "Environment Variables". Click on "New", and enter a new environment variable:

Name: MOSS
Value: %programfiles%\Common Files\Microsoft Shared\web server extensions\12

Notice that I've also used another variable in this variable: "%programfiles%". After saving the variable, we can now easily navigate to the "12" hive from windows explorer simply by typing "%moss%". This applies to the command shell as well.

While at it, we can also add the "bin" folder of our "12" hive into the PATH variable. Now, from the command shell, we could run "stsadm" from any path :) Shaves off a couple of miliseconds, but it does add-up.