Skip to content

Instantly share code, notes, and snippets.

@anonyfoxp
Created September 18, 2016 03:25
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anonyfoxp/916543d17bfdffbf1bf3ee47beece3d8 to your computer and use it in GitHub Desktop.
Save anonyfoxp/916543d17bfdffbf1bf3ee47beece3d8 to your computer and use it in GitHub Desktop.
@ECHO OFF&PUSHD %~DP0
TITLE title KMS_Activation for Windows 10
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行!&&Pause >nul&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion
::修改下面的内容,定义选择想使用的KMS服务器。如果定义了多次,最后的有效
::set KMS_Sev=192.168.2.8
::set KMS_Sev=1.2.7.0
set KMS_Sev=kms.lotro.cc
::set KMS_Sev=54.223.212.31
::set KMS_Sev=kms.guowaifuli.com
::set KMS_Sev=mhd.kmdns.net
::set KMS_Sev=xykz.f3322.org
::set KMS_Sev=106.186.25.239
::set KMS_Sev=110.noip.me
::set KMS_Sev=3rss.vicp.net:20439
::set KMS_Sev=45.78.3.223
::set KMS_Sev=kms.chinancce.com
::set KMS_Sev=kms.didichuxing.com
::set KMS_Sev=skms.ddns.net
::set KMS_Sev=zh.us.to
::set KMS_Sev=franklv.ddns.net
::set KMS_Sev=k.zpale.com
::set KMS_Sev=m.zpale.com
::set KMS_Sev=mvg.zpale.com
::set KMS_Sev=122.226.152.230
::set KMS_Sev=222.76.251.188
::set KMS_Sev=annychen.pw
::set KMS_Sev=heu168.6655.la
::set KMS_Sev=kms.aglc.cc
::set KMS_Sev=kms.landiannews.com
::set KMS_Sev=kms.shuax.com
::set KMS_Sev=kms.xspace.in
::set KMS_Sev=winkms.tk
::set KMS_Sev=wrlong.com
::======================= 以下内容无需更改 ======================
setlocal EnableDelayedExpansion&color 3e & cd /d "%~dp0"
title KMS_Activation_for_Office2016 - [hnfeng]
%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"
echo 正在安装 KMS 许可证...
for /f %%x in ('dir /b ..\root\Licenses16\project???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
for /f %%x in ('dir /b ..\root\Licenses16\standardvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
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\project???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
for /f %%x in ('dir /b ..\root\Licenses16\standardvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
for /f %%x in ('dir /b ..\root\Licenses16\visio???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
echo 正在导入 KMS GVLK...
cscript ospp.vbs /inpkey:NYH39-6GMXT-T39D4-WVXY2-D69YY >nul
cscript ospp.vbs /inpkey:7WHWN-4T7MP-G96JF-G33KR-W8GF4 >nul
cscript ospp.vbs /inpkey:RBWW7-NTJD4-FFK2C-TDJ7V-4C2QP >nul
cscript ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99 >nul
cscript ospp.vbs /inpkey:YG9NW-3K39V-2T3HJ-93F3Q-G83KT >nul
cscript ospp.vbs /inpkey:PD3PC-RHNGV-FXJ29-8JK7D-RJRJK >nul
echo 正在尝试 KMS 激活...
cscript //nologo ospp.vbs /sethst:%KMS_Sev% >nul
cscript //nologo ospp.vbs /act | find /i "successful" && (
echo.&echo ***** Office2016 激活成功 ***** & echo.) || (echo.&echo ***** Office2016 激活失败 ***** & echo.
echo 请检查网络是否畅通,以及选择修改其他的 KMS 服务器后再试)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment