1. 程式人生 > >Office2016零售版(Retail)轉批量授權(VOL)

Office2016零售版(Retail)轉批量授權(VOL)

來源:https://blog.csdn.net/wwwlfs/article/details/81484754 

@ECHO OFF&PUSHD %~DP0
setlocal EnableDelayedExpansion&color 3e & cd /d "%~dp0"
title office2016 retail轉換vol版
%1 %2
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :runas","","runas",1)(window.close)&goto :eof
:runas
if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16"
if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16"
:WH
cls
echo.
echo                         選擇需要轉化的office版本序號
echo.
echo --------------------------------------------------------------------------------                                                          
echo                 1. 零售版 Office Pro Plus 2016 轉化為VOL版
echo.
echo                 2. 零售版 Office Visio Pro 2016 轉化為VOL版
echo.
echo                 3. 零售版 Office Project Pro 2016 轉化為VOL版
echo.
echo. --------------------------------------------------------------------------------
 
set /p tsk="請輸入需要轉化的office版本序號【回車】確認(1-3): "
if not defined tsk goto:err
if %tsk%==1 goto:1
if %tsk%==2 goto:2
if %tsk%==3 goto:3
:err
goto:WH
:1
cls
echo 正在安裝 KMS 許可證...
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
echo 正在安裝 MAK 許可證...
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
set /p y=請輸入啟用金鑰,按回車確定:
cscript ospp.vbs /inpkey:%y%
goto :e
:2
cls
echo 正在安裝 KMS 許可證...
for /f %%x in ('dir /b ..\root\Licenses16\visio???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
echo 正在安裝 MAK 許可證...
for /f %%x in ('dir /b ..\root\Licenses16\visio???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
set /p y=請輸入啟用金鑰,按回車確定:
cscript ospp.vbs /inpkey:%y%
goto :e
:3
cls
echo 正在安裝 KMS 許可證...
for /f %%x in ('dir /b ..\root\Licenses16\project???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
echo 正在安裝 MAK 許可證...
for /f %%x in ('dir /b ..\root\Licenses16\project???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
set /p y=請輸入啟用金鑰,按回車確定:
cscript ospp.vbs /inpkey:%y%
goto :e
:e
echo.
echo 轉化完成,按任意鍵退出!
pause >nul
exit