Skip to content

Instantly share code, notes, and snippets.

@zu1k

zu1k/check.bat

Last active Nov 27, 2020
Embed
What would you like to do?
KMS脚本
@echo off
::配置BAT对话框样式
title KMS服务器检查脚本
MODE con: COLS=42 lines=8
color 0a
::检测vlmcs.exe
if exist "C:\vlmcs.exe" ( goto begin ) else ( goto fail )
::菜单
:begin
cls
echo.
echo. ------------------------------------
echo. --[1]-- 检测自定义服务器
echo.
echo. --[2]-- 检测 收集的多个服务器
echo. ------------------------------------
choice /c 12 /n /m "请选择【1-2】:"
echo. %errorlevel%
if %errorlevel% == 1 goto self
if %errorlevel% == 2 goto check
::检测自定义线路
:self
cls
echo.
echo. ------------------------------------
echo. 检测自定义服务器
echo.
set/p kmsroot=请输入:
if not defined kmsroot set kmsroot=none
echo.
echo. 配置成功,按【任意键】继续。
echo. ------------------------------------
pause>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 %kmsroot%
echo.
C:\vlmcs.exe -l 1 %kmsroot% 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】返回菜单。
pause 1>nul 2>nul
goto begin
::检测收集的线路
:check
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 kms.lgf.im
echo.
C:\vlmcs.exe -l 1 kms.lgf.im 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 kms.03k.org
echo.
C:\vlmcs.exe -l 1 s1.kms.03k.org 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 kms.moerats.com
echo.
C:\vlmcs.exe -l 1 kms.moerats.com 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 kms.library.hk
echo.
C:\vlmcs.exe -l 1 kms.library.hk 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 kms.cangshui.net
echo.
C:\vlmcs.exe -l 1 kms.cangshui.net 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 kms.v0v.bid
echo.
C:\vlmcs.exe -l 1 kms.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k01.v0v.bid
echo.
C:\vlmcs.exe -l 1 k01.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k02.v0v.bid
echo.
C:\vlmcs.exe -l 1 k02.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k03.v0v.bid
echo.
C:\vlmcs.exe -l 1 k03.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k04.v0v.bid
echo.
C:\vlmcs.exe -l 1 k04.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k05.v0v.bid
echo.
C:\vlmcs.exe -l 1 k05.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k06.v0v.bid
echo.
C:\vlmcs.exe -l 1 k06.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k07.v0v.bid
echo.
C:\vlmcs.exe -l 1 k07.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k08.v0v.bid
echo.
C:\vlmcs.exe -l 1 k08.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k09.v0v.bid
echo.
C:\vlmcs.exe -l 1 k09.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k10.v0v.bid
echo.
C:\vlmcs.exe -l 1 k10.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k11.v0v.bid
echo.
C:\vlmcs.exe -l 1 k11.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k12.v0v.bid
echo.
C:\vlmcs.exe -l 1 k12.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】继续。
pause 1>nul 2>nul
cls
echo.
echo. ------------------------------------
echo. 正在测试线路 k13.v0v.bid
echo.
C:\vlmcs.exe -l 1 k13.v0v.bid 2>nul | find /i "successful" 1>nul 2>nul && ( echo. & echo. ***** 该线路 可用 ***** ) || ( echo. & echo. ***** 线路 已失效 ***** )
echo. ------------------------------------
echo. 检测完成,按【任意键】返回菜单。
pause 1>nul 2>nul
goto begin
:fail
cls
echo.
echo. ------------------------------------
echo. 错误:未检测到 C:\vlmcs.exe
echo.
echo. 下载地址:https://github.com/Wind4/vlmcsd/releases
echo. ------------------------------------
echo. 缺少文件,按【任意键】返回菜单。
pause 1>nul 2>nul
goto begin
@echo off
mode con cols=75 lines=25
title KMS激活脚本
setlocal EnableDelayedExpansion&color 70 & cd /d "%~dp0"
%1 %2
ver|find "5.">nul&&goto :start
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :start","","runas",1)(window.close)&goto :eof
:start
echo 本脚本需要右键管理员运行
echo 适用于使用我的脚本激活了Windows的用户
set /p xuanze=【A】KMS激活Windows 【B】KMS激活Office 【C】清除Windows KMS 【D】清除Office KMS 请输入你的选择:
if /i "%xuanze%"=="a" cls&goto start1
if /i "%xuanze%"=="b" cls&goto start2
if /i "%xuanze%"=="c" cls&goto start3
if /i "%xuanze%"=="d" cls&goto start4
:start2
set KMS_Sev=kms.lgf.im
cls
echo 正在检查本机网络情况耐心等待
echo.
ping www.gstatic.com | find "超时" > NUL && goto fail
ping www.gstatic.com | find "目标主机" > NUL && goto fail
echo 本机网络良好……
goto office
:office
echo 检查安装的office……
call :GetOfficePath 14 Office2010
call :ActOffice 14 Office2010
call :GetOfficePath 15 Office2013
call :ActOffice 15 Office2013
if exist "%ProgramFiles%\Office2016\Office16\ospp.vbs" set _Office16Path=%ProgramFiles%\Office2016\Office16
if exist "%ProgramFiles(x86)%\Office2016\Office16\ospp.vbs" set _Office16Path=%ProgramFiles(x86)%\Office2016\Office16
if DEFINED _Office16Path (echo.&echo 已发现 Office2016
call :ActOffice 16 Office2016
) else (echo.&echo 未发现 Office2016)
echo.&pause
exit
:ActOffice
if DEFINED _Office%1Path (
cd /d "!_Office%1Path!"
if %1 EQU 16 call :Licens16
echo.&echo 尝试激活 %2 ...&echo.
cscript //nologo ospp.vbs /sethst:kms.lgf.im >nul
cscript //nologo ospp.vbs /act | find /i "successful" && (
echo.&echo ***** %2 激活成功 ***** & echo.) || (echo.&echo ***** %2 激活失败 ***** & echo.)
)
cd /d "%~dp0"
goto :EOF
:GetOfficePath
echo.&echo 正在检测 %2 系列产品的安装路径...
set _Office%1Path=
set _Reg32=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\%1.0\Common\InstallRoot
set _Reg64=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\%1.0\Common\InstallRoot
reg query "%_Reg32%" /v "Path" > nul 2>&1 && FOR /F "tokens=2*" %%a IN ('reg query "%_Reg32%" /v "Path"') do SET "_OfficePath1=%%b"
reg query "%_Reg64%" /v "Path" > nul 2>&1 && FOR /F "tokens=2*" %%a IN ('reg query "%_Reg64%" /v "Path"') do SET "_OfficePath2=%%b"
if DEFINED _OfficePath1 (if exist "%_OfficePath1%ospp.vbs" set _Office%1Path=!_OfficePath1!)
if DEFINED _OfficePath2 (if exist "%_OfficePath2%ospp.vbs" set _Office%1Path=!_OfficePath2!)
set _OfficePath1=
set _OfficePath2=
if DEFINED _Office%1Path (echo.&echo 已发现 %2) else (echo.&echo 未发现 %2)
goto :EOF
:Licens16
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
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
cscript ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP >nul
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
goto :EOF
exit
:fail
cls
echo 无法连接到服务器……
pause
:start1
set KMS_Sev=kms.lgf.im
cls
echo 如果提示未找到序列号,请手动在CMD里运行
echo reg QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID"
echo 这个命令,查看不支持的结果和系统版本
echo 正在检查本机网络情况耐心等待
echo.
ping www.gstatic.com | find "超时" > NUL && goto fail
ping www.gstatic.com | find "目标主机" > NUL && goto fail
echo 本机网络良好……
ver | find "6.0." > NUL && goto winvista
ver | find "6.1." > NUL && goto win7
ver | find "6.2." > NUL && goto win8
ver | find "6.3." > NUL && goto win81
ver | find "10.0." > NUL && goto win10
echo 未找到合适的NT6系统,可能是WinXP或Win2003。
goto office
:winvista
echo 当前为Windows Vista/2008。
set Business=YFKBB-PQJJV-G996G-VWGXY-2V3X8
set BusinessN=HMBQG-8H2RH-C77VX-27R82-VMQBT
set Enterprise=VKK3X-68KWM-X2YGT-QR4M6-4BWMV
set EnterpriseN=VTC42-BM838-43QHV-84HX6-XJXKV
set ServerWeb=WYR28-R7TFJ-3X2YQ-YCY4H-M249D
set ServerStandard=TM24T-X9RMF-VWXK6-X8JC9-BFGM2
set ServerStandardV=W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ
set ServerEnterprise=YQGMW-MPWTJ-34KDK-48M3W-X4Q6V
set ServerEnterpriseV=39BXF-X8Q23-P2WWT-38T2F-G3FPG
set ServerWeb=RCTX3-KWVHP-BR6TB-RB6DM-6X7HP
set ServerDatacenter=7M67G-PC374-GR742-YH8V4-TCBY3
set ServerDatacenterV=22XQ2-VRXRG-P8D42-K34TD-G3QQC
set ServerEnterpriseIA64=4DWFP-JF3DJ-B7DTH-78FJB-PDRHK
goto windowsstart
:win7
echo 当前为Windows 7/2008 R2。
set Professional=FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
set ProfessionalN=MRPKT-YTG23-K7D7T-X2JMM-QY7MG
set ProfessionalE=W82YF-2Q76Y-63HXB-FGJG9-GF7QX
set Enterprise=33PXH-7Y6KF-2VJC9-XBBR8-HVTHH
set EnterpriseN=YDRBP-3D83W-TY26F-D46B2-XCKRJ
set EnterpriseE=C29WB-22CC8-VJ326-GHFJW-H9DH4
set ServerWeb=6TPJF-RBVHG-WBW2R-86QPH-6RTM4
set ServerHPC=TT8MH-CG224-D3D7Q-498W2-9QCTX
set ServerStandard=YC6KT-GKW9T-YTKYR-T4X34-R7VHC
set ServerEnterprise=489J6-VHDMP-X63PK-3K798-CPX3Y
set ServerDatacenter=74YFP-3QFB3-KQT8W-PMXWJ-7M648
set ServerEnterpriseIA64=GT63C-RJFQ3-4GMB6-BRFB9-CB83V
goto windowsstart
:win8
echo 当前为Windows 8/2012。
set Professional=NG4HW-VH26C-733KW-K6F98-J8CK4
set ProfessionalN=XCVCF-2NXM9-723PB-MHCB7-2RYQQ
set Core=BN3D2-R7TKB-3YPBD-8DRP2-27GG4
set Enterprise=32JNW-9KQ84-P47T8-D8GGY-CWCK7
set EnterpriseN=JMNMF-RHW7P-DMY6X-RF3DR-X2BQT
set CoreN=8N2M2-HWPGY-7PGT9-HGDD8-GVGGY
set CoreSingleLanguage=2WN2H-YGCQR-KFX6K-CD6TF-84YXQ
set CoreCountrySpecific=4K36P-JN4VD-GDC6V-KDT89-DYFKP
set ServerMultiPointPremium=XNH6W-2V9GX-RGJ4K-Y8X6F-QGJ2G
set ServerMultiPointStandard=HM7DN-YVMH3-46JC3-XYTG7-CYQJJ
set ServerStandard=XC9B7-NBPP2-83J2H-RHMBY-92BT4
set ServerDatacenter=48HP8-DN98B-MYWDG-T2DCC-8W83P
goto windowsstart
:win81
echo 当前为Windows 8.1。
set Professional=GCRJD-8NW9H-F2CDX-CCM8D-9D6T9
set ProfessionalN=HMCNV-VVBFX-7HMBH-CTY9B-B4FXY
set Enterprise=MHF9N-XY6XB-WVXMC-BTDCT-MKKG7
set EnterpriseN=TT4HM-HN7YT-62K67-RGRQJ-JFFXW
set ServerSolution=KNC87-3J2TX-XB4WP-VCPJV-M4FWM
set ServerStandard=D2N9P-3P6X9-2R39C-7RTCD-MDVJX
set ServerDatacenter=W3GGN-FT8W3-Y4M27-J84CP-Q3VJ9
set EmbeddedIndustry=32JNW-9KQ84-P47T8-D8GGY-CWCK7
goto windowsstart
:win10
echo 当前为Windows 10/Server 2016-2019。
set Core=TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
set CoreCountrySpecific=PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
set CoreN=3KHY7-WNT83-DGQKR-F7HPR-844BM
set CoreSingleLanguage=7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
set Professional=W269N-WFGWX-YVC9B-4J6C9-T83GX
set ProfessionalN=MH37W-N47XK-V7XM9-C7227-GCQG9
set Enterprise=NPPR9-FWDCX-D2C8J-H872K-2YT43
set EnterpriseN=DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
set Education=NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
set EducationN=2WH4N-8QGBV-H22JP-CT43Q-MDWWJ
set EnterpriseS=WNMTR-4C88C-JK8YV-HQ7T2-76DF9
set EnterpriseSN=2F77B-TNFGY-69QQF-B8YKP-D69TJ
set ServerDatacenter=CB7KF-BWN84-R7R2Y-793K2-8XDDG
set ServerStandard=WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY
set ServerEssentials=JCKRF-N37P4-C2D82-9YXRT-4M63B
set EnterpriseG=YYVX9-NTFWV-6MDM3-9PT4T-4M68B
set EnterpriseGN=44RPN-FTY23-9VTTB-MP9BX-T84FV
set ProfessionalEducation=6TP4R-GNPTD-KYYHQ-7B7DP-J447Y
set ProfessionalEducationN=YVWGF-BXNMC-HTQYQ-CPQ99-66QFC
set ProfessionalWorkstation=NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J
set ProfessionalWorkstations=NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J
set ProfessionalWorkstationsN=9FNHH-K3HBT-3W4TD-6383H-6XYWF
set ServerDatacenter=WMDGN-G9PQG-XVVXX-R3X43-63DFG
set ServerStandard=N69G4-B89J2-4G8F4-WWYCC-J464C
set ServerEssentials=WVDHN-86M7X-466P6-VHXV7-YY726
set ServerRdsh=CPWHC-NT2C7-VYW78-DHDB2-PG3GK
goto windowsstart
:windowsstart
for /f "tokens=3 delims= " %%i in ('reg QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionID"') do set EditionID=%%i
if defined %EditionID% (
cscript //Nologo %windir%\system32\slmgr.vbs /ipk !%EditionID%!
cscript //Nologo %windir%\system32\slmgr.vbs /skms kms.lgf.im
cscript //Nologo %windir%\system32\slmgr.vbs /ato
) else (
echo 找不到序列号,可能是旗舰版之类的系统……
)
echo.&pause
exit
:start4
set /p xuanze=是否真的要清除Office的KMS激活?【Y】继续 【N】关闭
if /i "%xuanze%"=="y" goto nextun
if /i "%xuanze%"=="n" exit
:nextun
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:6MWKP
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:D69YY
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:W8GF4
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:4C2QP
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:WFG99
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:G83KT
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /unpkey:RJRJK
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /unpkey:6MWKP
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /unpkey:D69YY
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /unpkey:W8GF4
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /unpkey:4C2QP
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /unpkey:WFG99
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /unpkey:G83KT
cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /unpkey:RJRJK
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /unpkey:6MWKP
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /unpkey:D69YY
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /unpkey:W8GF4
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /unpkey:4C2QP
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /unpkey:WFG99
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /unpkey:G83KT
cscript "C:\Program Files\Microsoft Office\Office15\OSPP.VBS" /unpkey:RJRJK
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /unpkey:6MWKP
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /unpkey:D69YY
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /unpkey:W8GF4
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /unpkey:4C2QP
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /unpkey:WFG99
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /unpkey:G83KT
cscript "C:\Program Files (x86)\Microsoft Office\Office15\OSPP.VBS" /unpkey:RJRJK
cscript "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" /unpkey:6MWKP
cscript "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" /unpkey:D69YY
cscript "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" /unpkey:W8GF4
cscript "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" /unpkey:4C2QP
cscript "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" /unpkey:WFG99
cscript "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" /unpkey:G83KT
cscript "C:\Program Files\Microsoft Office\Office14\OSPP.VBS" /unpkey:RJRJK
cscript "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" /unpkey:6MWKP
cscript "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" /unpkey:D69YY
cscript "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" /unpkey:W8GF4
cscript "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" /unpkey:4C2QP
cscript "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" /unpkey:WFG99
cscript "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" /unpkey:G83KT
cscript "C:\Program Files (x86)\Microsoft Office\Office14\OSPP.VBS" /unpkey:RJRJK
ping 127.0.0.1 -n 1 > nul
cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /remhst
cls
echo 清除完成
ping 127.0.0.1 -n 10 > nul
:start3
set /p xuanze=是否真的要清除Windows的KMS?【Y】继续 【N】关闭
if /i "%xuanze%"=="y" goto nextunw
if /i "%xuanze%"=="n" exit
:nextunw
slmgr /upk
slmgr /ckms
slmgr /rearm
cls
echo 清除完成,请重启电脑
ping 127.0.0.1 -n 10 > nul
@echo off
::获取运行路径
setlocal EnableDelayedExpansion
cd /d "%~dp0"
::定义bat外观
title office系列 retail转换vol版
MODE con: COLS=65 lines=26
color 0a
::获取管理员权限
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
::配置 KMS服务器
set kmsroot=kms.lgf.im
::检测office安装路径
if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" set officev=office2016-or-office365
cd /d "%ProgramFiles%\Microsoft Office\Office16"
if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" set officev=office2016-or-office365
cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16"
if exist "%ProgramFiles%\Microsoft Office\Office15\ospp.vbs" set officev=office2013
cd /d "%ProgramFiles%\Microsoft Office\Office15"
if exist "%ProgramFiles(x86)%\Microsoft Office\Office15\ospp.vbs" set officev=office2013
cd /d "%ProgramFiles(x86)%\Microsoft Office\Office15"
if exist "%ProgramFiles%\Microsoft Office\Office14\ospp.vbs" set officev=office2010
cd /d "%ProgramFiles%\Microsoft Office\Office14"
if exist "%ProgramFiles(x86)%\Microsoft Office\Office14\ospp.vbs" set officev=office2010
cd /d "%ProgramFiles(x86)%\Microsoft Office\Office14"
if not defined officev set officev=未检测office!你可能改变了默认安装目录!
::菜单
:begin
cls
echo.
echo.
echo.
echo. ===== office系列retail转换vol版 =====
echo.
echo. 1.零售版 Office Pro Plus 2016/365 转化为VOL版(常用)
echo. 2.零售版 Office Visio Pro 2016/365 转化为VOL版
echo. 3.零售版 Office Project Pro 2016/365 转化为VOL版
echo.
echo. 4.零售版 Office Pro Plus 2013 转化为VOL版(常用)
echo. 5.零售版 Office Visio Pro 2013 转化为VOL版
echo. 6.零售版 Office Project Pro 2013 转化为VOL版
echo.
echo. 7.零售版 Office Pro Plus 2010 转化为VOL版(常用)
echo. 8.零售版 Office Visio Pro 2010 转化为VOL版
echo. 9.零售版 Office Project Pro 2010 转化为VOL版
echo.
echo. 您已安装:%officev%
echo.
echo. 如果你的office是安装在非默认目录请:
echo. 复制此批处理到 office16/office15/office14 目录后运行
echo.
choice /c 123456789 /n /m "请选择【1-9】:"
echo. %errorlevel%
if %errorlevel% == 1 goto 1
if %errorlevel% == 2 goto 2
if %errorlevel% == 3 goto 3
if %errorlevel% == 4 goto 4
if %errorlevel% == 5 goto 5
if %errorlevel% == 6 goto 6
if %errorlevel% == 7 goto 7
if %errorlevel% == 8 goto 8
if %errorlevel% == 9 goto 9
::版本转换
:1
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses16\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
cscript ospp.vbs /inpkey:XQNVK-8JYDB-WJ9W3-YJ8YR-WFG99
goto :e
:2
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses16\visio???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses16\visio???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
cscript ospp.vbs /inpkey:PD3PC-RHNGV-FXJ29-8JK7D-RJRJK
goto :e
:3
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses16\project???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses16\project???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul
cscript ospp.vbs /inpkey:YG9NW-3K39V-2T3HJ-93F3Q-G83KT
goto :e
:4
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses15\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses15\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses15\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses15\%%x" >nul
cscript ospp.vbs /inpkey:YC7DK-G2NP3-2QQC3-J6H88-GVGXT
goto :e
:5
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses15\visio???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses15\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses15\visio???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses15\%%x" >nul
cscript ospp.vbs /inpkey:C2FG9-N6J68-H8BTJ-BW3QX-RM3B3
goto :e
:6
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses15\project???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses15\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses15\project???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses15\%%x" >nul
cscript ospp.vbs /inpkey:FN8TT-7WMH6-2D4X9-M337T-2342K
goto :e
:7
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses14\proplusvl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses14\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses14\proplusvl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses14\%%x" >nul
cscript ospp.vbs /inpkey:VYBBJ-TRJPB-QFQRF-QFT4D-H3GVB
goto :e
:8
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses14\visio???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses14\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses14\visio???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses14\%%x" >nul
cscript ospp.vbs /inpkey:7MCW8-VRQVK-G677T-PDJCM-Q8TCP
goto :e
:9
cls
echo.
echo.
echo.
echo. 正在安装 KMS 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses14\project???vl_kms*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses14\%%x" >nul
echo. 正在安装 MAK 许可证...
echo.
for /f %%x in ('dir /b ..\root\Licenses14\project???vl_mak*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses14\%%x" >nul
cscript ospp.vbs /inpkey:YGX6F-PGV49-PGW3J-9BTGG-VHKC6
goto :e
::操作完成
:e
echo.
echo. 操作完成,按任意键返回开始菜单!
pause >nul
goto begin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.