Monday, August 1, 2011

Create batch file to deploye a webpart in a Sharepoint Site

Create new text file setup.bat and paste below code and save it :

@rem======================================================================
@rem      setup.bat
@rem
@rem======================================================================
@echo off
setlocal
pushd .
goto LInitialize

@rem----------------------------------------------------------------------
@rem    LInitialize
@rem----------------------------------------------------------------------
:LInitialize
    set SPLocation=%CommonProgramFiles%\Microsoft Shared\web server extensions\12
    set SPAdminTool=%SPLocation%\BIN\stsadm.exe
    set Install=
    set Uninstall=
    set PackageFile=WSPPAckageNAme.wsp
    set PackageName=WSPPackageName.wsp
   set DefaultWebUrl=http://ServerName:29393
    set DefaultSiteUrl=http://ServerNAme:29393
    set TargetWebUrl=http://ServerName:29393
    set TargetSiteUrl=
    set SPTemplateLocation=%SPLocation%\template
    set SPFeaturesLocation=%SPTemplateLocation%\features
    set SPSiteTemplateLocation=%SPTemplateLocation%\sitetemplates
    set ValidationFailed=
    "%SPAdminTool%" -o addsolution -filename "%PackageFile%"

pause
    goto :EOF
popd
endlocal

No comments:

Post a Comment