- 积分
- 162
- 最后登录
- 2024-4-25
- 精华
- 0
- 阅读权限
- 20
- 主题
- 9
- UID
- 540970
- 帖子
- 406
- PB币
- 474
- 威望
- 0
- 贡献
- 0
- 技术
- 0
- 活跃
- 1053
- UID
- 540970
- 帖子
- 406
- PB币
- 474
- 贡献
- 0
- 技术
- 0
- 活跃
- 1053
|
本帖最后由 斜阳残雪 于 2012-11-13 10:19 编辑
如题, 本帖是我自己做的用于局域网激活的脚本, 激活服务器请自理, 本帖旨在自动获取office安装路径, 望明确.
- @echo off
- set "kmsHost=x.x.x.x"
- setlocal EnableDelayedExpansion
- cls
- color 02
- echo getting directory...
- for /f "delims=" %%i in ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Word\Options" /v "PROGRAMDIR"') do (
- set strInstPath=%%i
- set strInstPath=!strInstPath:*REG_SZ=!
- )
- :LTrim
- if "%strInstPath:~0,1%"==" " set "strInstPath=%strInstPath:~1%" && goto LTrim
- :RTrim
- if "%strInstPath:~-1%"==" " set "strInstPath=%strInstPath:~0,-1%" && goto RTrim
- if "%strInstPath:~-1%" neq "\" set strInstPath=%strInstPath%\
- cd /d %strInstPath%
- echo.
- echo installing key...
- cscript.exe //nologo ospp.vbs /inpkey:YC7DK-G2NP3-2QQC3-J6H88-GVGXT
- set /p ynPJ=installed Project?[y/n]:
- if "%ynPJ%"=="y" cscript.exe //nologo ospp.vbs /inpkey:FN8TT-7WMH6-2D4X9-M337T-2342K
- set /p ynVISIO=installed Visio?[y/n]:
- if "%ynVISIO%"=="y" cscript.exe //nologo ospp.vbs /inpkey:C2FG9-N6J68-H8BTJ-BW3QX-RM3B3
- echo.
- echo setting host IP address...
- cscript.exe //nologo ospp.vbs /sethst:%kmsHost%
- echo.
- echo activating...
- cscript.exe //nologo ospp.vbs /act
- echo.
- echo checking...
- cscript.exe //nologo ospp.vbs /dstatus
- pause
复制代码
|
|