- 将以下命令保存为 "KMS_Online.bat" 文件并以管理员身份运行;
- 此脚本支持 Windows 7/10, Office 2010/2013/2016 等版本。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
@color 1F & echo off @title KMS Online Activation by Desen mode con cols=120 lines=60 reg add HKEY_CURRENT_USER\Console\%%SystemRoot%%_system32_cmd.exe /v "WindowPosition" /t REG_DWORD /d 0x001401c2 /f cls echo 请右键 "以管理员身份运行" 此批处理脚本 echo =================================================== echo 以下 KMS 密钥来源于微软 echo Office 2016:https://docs.microsoft.com/zh-cn/DeployOffice/vlactivation/gvlks echo Office 2013:https://docs.microsoft.com/zh-cn/previous-versions/office/dn385360(v=office.15) echo Office 2010:https://docs.microsoft.com/zh-cn/previous-versions/office/office-2010/ee624355(v=office.14) echo Windows:https://docs.microsoft.com/zh-cn/windows-server/get-started/kmsclientkeys echo 备用 KMS 服务器:kms.2bmi.com set KMS=kms.03k.org echo =================================================== echo 开始执行 Microsoft Windows 激活 set CSCRIPT="C:\Windows\system32\cscript.exe" set SLMGR="C:\Windows\system32\slmgr.vbs" %CSCRIPT% %SLMGR% /ckms %CSCRIPT% %SLMGR% /upk %CSCRIPT% %SLMGR% /skms %KMS% echo 弹出提示窗口请单击 "确定" 按钮继续 for /F "tokens=3" %%a in ('wmic os get Caption /VALUE') do ( if "%%a" NEQ "" (set "VER=%%a") ) set "VER=%VER: =%" if "%VER%" EQU "10" (set "SN=6TP4R-GNPTD-KYYHQ-7B7DP-J447Y") if "%VER%" EQU "7" (set "SN=FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4") for /F "tokens=5" %%b in ('wmic os get Caption /VALUE') do ( if "%%b" NEQ "" (set "LTSC=%%b") ) if "%LTSC%" EQU "LTSC" (set "SN=M7XTQ-FN8P6-TTKYV-9D4CC-J462D") if "%SN%" NEQ "" (%SLMGR% /ipk %SN%) else (goto SNERR) %CSCRIPT% %SLMGR% /ato %CSCRIPT% %SLMGR% /dlv echo 如果激活失败请执行 cscript %SLMGR% /rearm 命令后重启系统并重新激活 echo =================================================== echo 开始执行 Microsoft Office 激活 if EXIST "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" (set "KEY=VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB") if EXIST "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" (set OSPP="C:\Program Files\Microsoft Office\Office14\OSPP.VBS") if EXIST "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" (set "KEY=VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB") if EXIST "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" (set OSPP="C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS") if EXIST "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" (set "KEY=YC7DK-G2NP3-2QQC3-J6H88-GVGXT") if EXIST "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" (set OSPP="C:\Program Files\Microsoft Office\Office15\OSPP.VBS") if EXIST "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" (set "KEY=YC7DK-G2NP3-2QQC3-J6H88-GVGXT") if EXIST "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" (set OSPP="C:\Program Files\Microsoft Office\Office15\OSPP.VBS") if EXIST "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" (set "KEY=XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99") if EXIST "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" (set OSPP="C:\Program Files\Microsoft Office\Office16\OSPP.VBS") if EXIST "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" (set "KEY=XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99") if EXIST "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" (set OSPP="C:\Program Files\Microsoft Office\Office16\OSPP.VBS") %CSCRIPT% %OSPP% /remhst %CSCRIPT% %OSPP% /sethst:%KMS% if "%KEY%" NEQ "" (%CSCRIPT% %OSPP% /inpkey:%KEY%) else (goto KEYERR ) %CSCRIPT% %OSPP% /act %CSCRIPT% %OSPP% /dstatus echo 如果激活失败请执行 cscript %OSPP% /rearm 命令后重新激活 goto EXIT :SNERR echo 没有找到 Windows 对应的密钥, Windows 激活失败 goto EXIT :KEYERR echo 没有找到 Office 对应的密钥, Office 激活失败 goto EXIT :EXIT echo =================================================== echo 5 秒后自动退出,谢谢使用! ping 127.1 -n 5 > nul |
文章出自: 本站技术文章均为原创,版权归 "Desen往事 - 个人博客" 所有;部分图片来源于 Yandex ,转载本站文章请注明来源。