将以下内容复制、粘帖到记事本
---------------无聊的分割线----------------------
:: ===========================
@set OfficeVer=2016
:: ===========================
@echo off&color 3e&mode con cols=60 lines=6
title KMS_Activation for OfficeVL_2016/2013/2010
call :strset
ver | find " 5." >nul 2>nul && goto :runas
echo.&echo %str1% &echo.
%1 %2
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :runas","","runas",1)(window.close)&goto :eof
:runas
:: ==================================================
:: 你可以使用文本编辑器(例如记事本)编辑该批处理文件
:: 按照下列格式添加新的 KMS 服务器。
set KMS1=kms.lotro.cc
set KMS2=m.zpale.com
set KMS3=kms.03k.org
set KMS4=kms.chinancce.com
set KMS5=kms.digiboy.ir
set KMS6=kms.imazes.org
set KMS7=kms-win.msdn123.com
:: 最多可以设置 50 个KMS服务器 ======================
mode con cols=85 lines=25
setlocal EnableDelayedExpansion&color 3e
call :netchk
echo.&echo %str5%
:InputVer
if not defined OfficeVer set OfficeVer=2013
echo.&echo %str6% (2010,2013,2016)
set /P OfficeVer="%str7% %OfficeVer% : "
if "%OfficeVer%a"=="2010a" set "OfficeXX=14" & goto :GetPath
if "%OfficeVer%a"=="2013a" set "OfficeXX=15" & goto :GetPath
if "%OfficeVer%a"=="2016a" set "OfficeXX=16" & goto :GetPath
echo.&echo %str8% & echo.&goto :InputVer
:GetPath
set OfficePath=
call :GetOfficePath %OfficeXX% OfficePath
if not defined OfficePath (
echo.&echo %str9% Office%OfficeVer%
echo.&echo %str10% & pause>nul 2>&1 & goto :InputVer)
echo %bar%%bar%%bar%
echo.& echo %str11% Office%OfficeVer% %str12%
echo %OfficePath%
echo.&echo %str13%
echo.
ver | find " 5." > NUL 2>&1 && (pause>nul 2>&1) || timeout /t 10
echo %bar%%bar%%bar%
cd /d "%OfficePath%"
for /L %%a in (1,1,50) do (
if defined KMS%%a (
echo %str14% !KMS%%a!
cscript //Nologo ospp.vbs /sethst:!KMS%%a! >nul
(cscript //nologo ospp.vbs /act) ^| find /i "successful" && (call :successful !KMS%%a!)))
goto failure
exit
:strset
chcp | find "936" > nul && (
set bar=======================
set str1=请允许以管理员身份运行...
set str2=正在检测网络,请稍等...
set str3=请检查网络是否通畅。
set str4=按任意键退出...
set str5=建议直接安装Office VL版,或者先由其他工具转换为VL版,再使用该批处理。
set str6=请输入Office的版本
set str7=直接回车默认为
set str8=输入错误,请重新输入:
set str9=系统中未找到:
set str10=按任意键重新输入.
set str11=找到了
set str12=的安装路径:
set str13=已经准备好,按任意键开始...
set str14=正在尝试的 KMS:
set str15=恭喜!已经成功激活!
set str16=使用的 KMS 服务器是:
set str17=运气不佳哦,激活失败。
set str18=请确认Office是VL版或已经成功转换为VL版
set str19=较少的可能是所有KMS全部失效。请更新KMS列表。
)
chcp | find "950" > nul && (
set bar=======================
set str1=叫す砛恨瞶ō笲︽...
set str2=タ浪代蔍蹈叫祔单...
set str3=叫浪琩蔍蹈琌硄篫
set str4=ヴ種龄癶...
set str5=某钡杆Office VL┪パㄤㄣ锣传VLㄏノ赣у矪瞶
set str6=叫块Officeセ
set str7=钡ó纐粄
set str8=块岿粇叫穝块:
set str9=╰参いゼт:
set str10=ヴ種龄穝块.
set str11=т
set str12=杆隔畖
set str13=竒称ヴ種龄秨﹍...
set str14=タ沽刚 KMS
set str15=尺, 竒Θ縀...
set str16=ㄏノ KMS 狝叭竟琌:
set str17=笲蒩ぃㄎ瓳縀ア毖
set str18=叫谔粄Office琌VL┪竒Θ锣传VL
set str19=耕ぶ琌┮ΤKMS场ア叫穝KMS
)
chcp | findstr "936 950" > nul || (
set bar=======================
set str1=Please allow to Run As Administrator.
set str2=Checking the network, Please wait a moment...
set str3=Please check if the network is open.
set str4=Press any key to EXIT...
set str5=Install the Office VL version, or convert it to VL version by other tools, and then run this BAT.
set str6=Please enter the version of Office
set str7=Enter the default is
set str8=Input error, please re-enter:
set str9=Not found:
set str10=Press any key to re-enter
set str11=Found The
set str12=Installation Path:
set str13=Ready, press any key to start...
set str14=Trying KMS server:
set str15=Ha-ha, Product activation successful.
set str16=The KMS server is:
set str17=Sorry, Activation failure.
set str18=Please make sure that Office is VL or has successfully been converted to VL.
set str19=All KMS may be invalid. Please update the KMS list.
)
goto :EOF
:failure
cls&color 1e
echo.&echo %bar%%bar%%bar%
echo %str17% &echo.&echo %str18%
echo.&echo %str19%
echo %bar%%bar%%bar%&echo.
echo %str4% & pause>nul
exit
:successful
cls&color ce
echo.&echo %bar%%bar%%bar%
echo %str15% &echo.&echo %str16% %1
echo %bar%%bar%%bar%&echo.
echo %str4% & pause>nul
exit
:netchk
echo %str2%
ping -n 1 www.qq.com | find /i "TTL" > nul && (cls & goto :EOF)
ping -n 1 www.baidu.com | find /i "TTL" > nul && (cls & goto :EOF)
echo.&echo %str3% & echo. & echo %str4% & pause>nul
exit
:GetOfficePath
:: 用途:获取Office安装路径。支持 Retail,VL,ClickToRun 等版本的Office
:: 编写:XXXXXXXX
:: 使用方法: call :GetOfficePath %1 Var
:: %1 是 office的版本号,如 14,15,16
:: 结果:变量 Var 存放Office的安装路径
setlocal & set _OfficePath=
for /f "tokens=2*" %%G in ('"reg query HKLM\SOFTWARE\Microsoft\Office\%1.0\Common\InstallRoot /v Path" 2^>nul') do set "_Path1=%%H"
for /f "tokens=2*" %%G in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\%1.0\Common\InstallRoot /v Path" 2^>nul') do set "_Path2=%%H"
for /f "tokens=2*" %%G in ('"reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath" 2^>nul') do set "_Path3=%%H\Office%1"
if exist "%_Path1%\OSPP.VBS" (set "_OfficePath=%_Path1%") else (
if exist "%_Path2%\OSPP.VBS" (set "_OfficePath=%_Path2%") else (
if exist "%_Path3%\OSPP.VBS" (set "_OfficePath=%_Path3%") else (
if exist "%ProgramFiles%\Microsoft Office\Office%1\OSPP.VBS" (set "_OfficePath=%ProgramFiles%\Microsoft Office\Office%1") else (
if exist "%ProgramFiles(x86)%\Microsoft Office\Office%1\OSPP.VBS" (set "_OfficePath=%ProgramFiles(x86)%\Microsoft Office\Office%1") else (
if exist "C:\Program Files\Microsoft Office\Office%1\OSPP.VBS" (set "_OfficePath=C:\Program Files\Microsoft Office\Office%1") else (
if exist "C:\Program Files (x86)\Microsoft Office\Office%1\OSPP.VBS" (set "_OfficePath=C:\Program Files (x86)\Microsoft Office\Office%1")
))))))
endlocal & IF "%~2" NEQ "" set "%~2=%_OfficePath%"
goto :EOF
---------------无聊的分割线----------------------
然后更改成“Office_KMS_Activation.bat”,最后右键管理员身份运行试试(复制不包括分割线) |