By default, the SharePoint bin directory in 14 hive is not added to the system path. When you type “STSADM” in the command prompt, you get the following error:
”STSADM is not recognized as an internal or external command”
The above error is displayed because SharePoint BIN directory is not added to the system path. As a SharePoint administrator, you frequently have to use STSADM for administration and it’s a pain to type the full path again and again. If you add the path of SharePoint bin directory to the system path on your server, you can use STSADM without having to change directory all the time. The directions are provided below:
- Get the SharePoint 2010 bin directory path. If you have installed SharePoint in C:\ drive using default installation options, the default path would be C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN.
- Select Start and right click on “Computer” and select “Properties” from the menu. The system window will be displayed.
Select “Advanced system Settings” that will display the “System Properties” window.
Select “Environment Variables…” button that will display the “Environment Variables” window.
In the “System variables” section, scroll down, select “Path”, and select “Edit…”. - The current variable value of the “Path” variable on my test server is following.
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\
What I have to do is at the end of last path, which is “\BINN\” in my case, type a semicolon and type the path of SharePoint 2010 bin directory in the 14 hive.
;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
WARNING: WE ARE ADDING THE SHAREPOINT BIN DIRECTORY PATH TO THE SYSTEM PATH VARIABLE. DO NOT ACCIDENTLY REPLACE THE WHOLE SYSTEM PATH OTHERWSIE YOUR SERVER WILL STOP WORKING! - Select “OK” on the “Edit System Variable” screen, select “OK” in the “Environment Variables” screen, and select “OK” in the “System Properties” screen.
- Close the command prompt and open it again as an administrator. If you do not run the command prompt using administrator, you will get “Access Denied” error due to UAC. After starting the command prompt as an administrator, type “STSADM” without quotes and this time you will see the available options.
No comments:
Post a Comment