Assume you already got a solution package (.wsp) of the web part. First, you have to install it: SET STSADM="%full path%\STSADM.EXE" SET URL="http://urlOfMySite" SET SPACK="myWebPart.wsp" %STSADM% -o retractsolution -name %SPACK% ...
Microsoft SharePoint Full Article Link - SharePoint: How to add a web part to a page from a solution package