前段时间做了一个修改密码的 webpart,考虑到 webpart 安装过程异常繁琐且容易出错,就写了个批处理脚本,无论是用在Webpart的调试上,还是真正要安装webpart 感觉方便了好多!而且是“绿色安装”。感兴趣的话可以参照下面脚本:

@echo off
@echo **************************
@echo *修改密码Web Part 1.0.0.1*
@echo **************************


@echo 请选择:
@echo 1.安装请按 A
@echo 2.卸载请按 B
@echo 3.退出请按 C
choice /c:abc 
if errorlevel 3 goto cancel
if errorlevel 2 goto uninstall
if errorlevel 1 goto install

:cancel
goto end

:uninstall
@echo 确定卸载该Web Part ?
choice /c:yn
if errorlevel 2 goto end
if errorlevel 1 goto yes
:yes
stsadm.exe -o deletewppack  -name ChangePasswordPart.cab
goto end

:install
@echo 安装到:
@echo 1.程序集(GAC)请按 A
@echo 2.程序bin目录请按 B
@echo 3.取消安装请按 C
@echo  ... 30秒后将自动选 A ...
choice /T 30 /c abc /D a
if errorlevel 3 goto end
if errorlevel 2 goto bin
if errorlevel 1 goto gac

:gac
stsadm.exe -o addwppack -force -globalinstall -filename ChangePasswordPart.cab
goto end

:bin
stsadm.exe -o addwppack -force -filename ChangePasswordPart.cab

:end
@echo goodbye!
pause

相关文章:

  • 2021-06-21
  • 2021-06-21
  • 2021-05-24
  • 2021-12-30
  • 2021-12-19
  • 2022-02-04
  • 2022-01-05
  • 2021-11-11
猜你喜欢
  • 2022-12-23
  • 2021-06-02
  • 2022-02-19
  • 2022-12-23
  • 2022-01-11
  • 2022-03-06
  • 2021-11-05
相关资源
相似解决方案