12345

TechTips - Create STSADM Shortcuts for SharePoint 2007

TechTips
If you spend any amount of time administering SharePoint 2007 then you are probably familiar with the STSADM command line tool. This tool is the best way to get things done in SharePoint and if you aren't familiar with it then you should check it out, there are entire blogs dedicated to it, it's that powerful. The problem I have with the STSADM command is that out of the box it's not the easiest tool to get to and use. So I have come up with a few ways to make the STSADM tool easier to use with fewer steps, I will explain two simple to use methods in this article.

So the reason for this article is in the past each time I wanted to use STSADM, I had to open a command prompt, get to the directory where the file is stored (Usually in - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN). To get to this directory and then start using commands is a real pain to do each time you want to use the tool. If you are like me you also have a SharePoint Farm with like 3-5 servers and on each server you have to run the tool and have to get to the command line directory. It is time consuming and there is a much easier way to use the STSADM command.

So the first fix that I created was a simple desktop shortcut that takes me to the command prompt at the directory (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN). This is one way to get to the STSADM command quickly. To create this shortcut; follow these steps:

Login to the SharePoint 2007 Server

Right Click on the Desktop

Click New

Click Shortcut

Click Browse

Click Computer>>C:\>>Windows>>System32>>Cmd.exe

Click OK

Click Next

Name the File (STSADM, is what I used)

Click Finish

Right Click the Shortcut you just created

Click Properties

Click the Start in text box and Paste the STSADM path (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN)

Click OK

Now when you double click the STSADM shortcut it will open a command prompt in the proper directory so you can easily run STSADM commands on your SharePoint server. Don't forget to do this on every one of your SharePoint servers in your SharePoint Farm.

There is another method that might be easier, I am still not sure which option is the best/easiest. The second option is to add the STSADM directory (C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN) to your path. To do this; follow these steps:

Login to your SharePoint 2007 Server

Click Start

Right Click My Computer

Click Properties

Click the Advanced Tab

Click Environment Variables Button

Click Path in the System Variables Section (it will highlight it in blue)

Click Edit

Click Variable Value Text box and go to the end of the line

Type ; (the actual symbol) and paste the path for your STSADM command (Should be - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN)

Click OK

Click OK

Click OK

Click Start

Click Run

Type CMD

Hit Enter

Run a simple STSADM command as a test (It should work)

This second option gives you the ability to run the STSADM command from the default command prompt without having to navigate to the path of the STSADM command. So no more typing the entire directory path each time you want to use STSADM command.

Either one of these methods will get you to the same goal, which is to save you time when trying to run your STSADM commands. No more having to remember the directory and spend time getting to the location of the actual STSADM.exe file. You can use either method, there isn't really a better reason to use one vs. the other, they both work and are both simple to use and should really raise any security concerns on the system.

Well I hope this guide and screenshots help you to save time when trying to run STSADM commands for SharePoint 2007.

Published by TechTips

I am a senior systems engineer and enjoy writing articles about computers, technology and other electronics.  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.