SharePoint Quick Tip – execadmsvcjobs
June 15, 2009 Leave a comment
A quick tip (as the title of this post states) for SharePoint, useful for both administrators and developers. Often in these roles, you are working wither within Central Administration, deploying, retracting, and removing solutions from your environment.
In doing so, you can either specify a time for these jobs to be run, then you definitely have to wait, or, you just need to wait for the SharePoint Timer Service to run these jobs for you. Or, you do have the option of firing up the command prompt, and running
stsadm -o execadmsvcjobs
That is all well and good, but, wouldn’t it be easier just to click a button? That is what this quick tip is all about. The solution? Just create a batch file to do this for you, and drop it on the quick-launch for easy access.
If you are unfamiliar with creating batch files, here is how to accomplish this.
- Open up notepad
- Paste in the following (be sure to change the path to your stsadm executable on the first line it it is not located in the same place, for example, on drive D rather than C)
- Save the file as execadmsvcjobs.bat (be sure to select All Types (*.*) from the Save as type drop-down dialog, so .txt is not appended to the filename, resulting in execadmsvcjobs.bat.txt)
- Once saved, browse to the location where you have just saved this file, right click on it, and choose Send To > Desktop (create shortcut) from the context menu.
- Drag the shortcut icon into your Quick Launch bar
- Click on it to run!
@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm.exe"
@ECHO.
@ECHO Executing Jobs...
%STSADM% -o execadmsvcjobs
Makes the process quick and simple. If you have other batch scripts which you run frequently, it may even be useful to have a toolbar itself setup to group these all together for easy access.