DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Sharepoint "Fab 40" Templates - Batch File Deployment Helper

07.27.2007
| 2421 views |
  • submit to reddit
        /*

File below should live here:
\\server\c$\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
 
Unpack the templates to the same directory and then run the install.bat file
 
------------------------------------------------------------- 
 
Copy/paste below to make the install.bat file
 
-------------------------------------------------------------

*/


 
::install.bat for WSP Template files
::Created by Will Pritchard
:START
@ECHO OFF
SET /P INPUT="Please enter the name of the .wsp file you want to deploy: "
ECHO.
ECHO Starting deployment of %INPUT%
:CHOICE
SET /P CHOICE="Are you sure you want to continue? (Y or N): "
if %CHOICE%==Y goto YES
if %CHOICE%==y goto YES
if %CHOICE%==N goto NO
if %CHOICE%==n goto NO
ECHO %CHOICE% is not recognized.  Please re-enter your answer.
goto CHOICE
:YES
ECHO Adding the Solution.
stsadm -o addsolution -filename %INPUT%
ECHO Executing service jobs.
stsadm -o execadmsvcjobs
ECHO Deploying the Solution.
stsadm -o deploysolution -name %INPUT% -immediate -allowGacDeployment -allowCasPolicies
ECHO Final Execution processing.
stsadm -o execadmsvcjobs
GOTO END
:NO
EXIT
:END
ECHO All Done!
:MORE
SET /P MORE="Want to install another solution? (Y or N): "
if %MORE%==Y goto START
if %MORE%==y goto START
if %MORE%==N goto NO
if %MORE%==n goto NO
ECHO %CHOICE% is not recognized.  Please re-enter your answer.
goto MORE