Run STSADM from anywhere by changing “Path” Environment Variable

Getting “‘stsadm’ is not recognized as an internal or external command, operable program or batch file.” when trying to run the stsadm command-line tool? This is because the stsadm tool is located at: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN folder, and when you try to access it from other folders (typically, command line opens in “C:\Users\Your-User-Name”), the command shell may not know where exactly stsadm.exe is located.

So, How to run stsadm from any directory from your SharePoint servers? Simple. Just add the stsadm’s location to the “Path” Environment variable. here is how:

  1. Start > All Programs > Control Panel > System.
  2. Select Advanced System Settings, click the Environment Variables button.
  3. Under System Variables, Scroll to Path and click the Edit button.
  4. Add the following to the end of the Variable value field:

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

For SharePoint 2010, it would be: C:\Program Files\Common Files\Microsoft Shared\web server extensions\14

Run STSADM from any directory

How About SharePoint 2010 and SharePoint 2013?

  • For SharePoint 2010, Set this path to: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\BIN 
  • For SharePoint 2013, Its goes as: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\BIN

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *