Skip to content

Instantly share code, notes, and snippets.

@andrewthauer
Last active August 19, 2016 01:36
Show Gist options
  • Save andrewthauer/afcdb7601e7780ab62be to your computer and use it in GitHub Desktop.
Save andrewthauer/afcdb7601e7780ab62be to your computer and use it in GitHub Desktop.
SharePoint WebPart deployment script
@echo off
rem ## --- User variables ---
@set URL=<deploy_site_url>
rem ## --- Other variables ---
@set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN;%PATH%
@set FEATURE_NAME=<wsp_feature_name>
@set WSP_NAME=<wsp_name>
@set WSP_FILE=%WSP_NAME%
@set WSP_PATH=.
stsadm -o deactivatefeature -name %FEATURE_NAME% -url "%URL%"
stsadm -o retractsolution -name %WSP_NAME% -immediate -allcontenturls
stsadm -o execadmsvcjobs
stsadm -o deletesolution -name %WSP_NAME% -override
stsadm -o execadmsvcjobs
stsadm -o addsolution -filename "%WSP_PATH%\%WSP_FILE%"
stsadm -o execadmsvcjobs
stsadm -o deploysolution -name %WSP_NAME% -immediate -allowGacDeployment -allowCasPolicies
stsadm -o execadmsvcjobs
stsadm -o activatefeature -name %FEATURE_NAME% -url "%URL%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment