KMS_VL_ALL_AIO/KMS_VL_ALL_AIO.cmd

5941 lines
286 KiB
Batchfile
Raw Permalink Normal View History

<!-- : Begin batch script
@setlocal DisableDelayedExpansion
@set uivr=v51
@echo off
:: ### Configuration Options ###
:: change to 1 to enable debug mode (can be used with unattended options)
2019-11-20 01:18:43 +01:00
set _Debug=0
:: change to 0 to turn OFF Windows or Office activation processing via the script
set ActWindows=1
set ActOffice=1
:: change to 0 to turn OFF auto conversion for Office C2R Retail to Volume
set AutoR2V=1
2022-10-26 19:52:28 +02:00
:: change to 0 to keep Office C2R vNext license (subscription or lifetime)
set vNextOverride=1
:: change to 0 to revert Windows 10/11 KMS38 to normal KMS
set SkipKMS38=1
:: ### Unattended Options ###
2019-11-20 01:18:43 +01:00
:: change to 1 and set KMS_IP address to activate via external KMS server unattended
set External=0
2022-05-29 13:00:44 +02:00
set KMS_IP=172.16.0.2
:: change to 1 to run Manual activation mode unattended
set uManual=0
2019-11-20 01:18:43 +01:00
:: change to 1 to run AutoRenewal activation mode unattended
set uAutoRenewal=0
:: change to 1 to suppress any output
set Silent=0
:: change to 1 to redirect output to a text file, works only with Silent=1
set Logger=0
:: ### Advanced KMS Options ###
:: change KMS auto renewal schedule, range in minutes: from 15 to 43200
:: example: 10080 = weekly, 1440 = daily, 43200 = monthly
set KMS_RenewalInterval=10080
:: change KMS reattempt schedule for failed activation or unactivated, range in minutes: from 15 to 43200
set KMS_ActivationInterval=120
:: change Hardware Hash for KMS emulator server (only affect Windows 8.1 and 10)
set KMS_HWID=0x3A1C049600B60076
:: change KMS TCP port
set KMS_Port=1688
:: change to 1 to use VBScript to access WMI
:: automatically enabled if wmic.exe is not installed
set WMI_VBS=0
:: change to 1 to use Windows PowerShell to access WMI
:: automatically enabled if wmic.exe and VBScript are not installed
set WMI_PS=0
:: ###################################################################
:: # NORMALLY THERE IS NO NEED TO CHANGE ANYTHING BELOW THIS COMMENT #
:: ###################################################################
set KMS_Emulation=1
set Unattend=0
2022-05-29 13:00:44 +02:00
set _uIP=172.16.0.2
set "_Null=1>nul 2>nul"
set _args=
set _elev=
set _batf=
set _batp=
set fAUR=
set rAUR=
set _args=%*
if not defined _args goto :NoProgArgs
set _args=%_args:"=%
for %%A in (%_args%) do (
if /i "%%A"=="-elevated" (set _elev=1
) else if /i "%%A"=="-wow" (set _rel1=1
) else if /i "%%A"=="-arm" (set _rel2=1
) else if /i "%%A"=="/d" (set _Debug=1
) else if /i "%%A"=="/u" (set Unattend=1
) else if /i "%%A"=="/s" (set Silent=1
) else if /i "%%A"=="/l" (set Logger=1
) else if /i "%%A"=="/o" (set ActOffice=1&set ActWindows=0
) else if /i "%%A"=="/w" (set ActOffice=0&set ActWindows=1
) else if /i "%%A"=="/c" (set AutoR2V=0
2022-10-26 19:52:28 +02:00
) else if /i "%%A"=="/v" (set vNextOverride=0
) else if /i "%%A"=="/x" (set SkipKMS38=0
) else if /i "%%A"=="/e" (set fAUR=0&set External=1&set uManual=0&set uAutoRenewal=0
) else if /i "%%A"=="/m" (set fAUR=0&set External=0&set uAutoRenewal=0
) else if /i "%%A"=="/a" (set fAUR=1&set External=0&set uManual=0
) else if /i "%%A"=="/r" (set rAUR=1
) else (set "KMS_IP=%%A")
)
:NoProgArgs
set "_cmdf=%~f0"
if exist "%SystemRoot%\Sysnative\cmd.exe" if not defined _rel1 (
setlocal EnableDelayedExpansion
start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" -wow %*"
exit /b
)
if exist "%SystemRoot%\SysArm32\cmd.exe" if /i %PROCESSOR_ARCHITECTURE%==AMD64 if not defined _rel2 (
setlocal EnableDelayedExpansion
start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" -arm %*"
exit /b
)
if %External% EQU 1 (if "%KMS_IP%"=="%_uIP%" (set fAUR=0&set External=0) else (set fAUR=0))
if %uManual% EQU 1 (set fAUR=0&set External=0&set uAutoRenewal=0)
if %uAutoRenewal% EQU 1 (set fAUR=1&set External=0&set uManual=0)
if defined fAUR set Unattend=1
if defined rAUR set Unattend=1
if %Silent% EQU 1 set Unattend=1
set _run=nul
if %Logger% EQU 1 set _run="%~dpn0_Silent.log"
set "SysPath=%SystemRoot%\System32"
set "Path=%SystemRoot%\System32;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\"
if exist "%SystemRoot%\Sysnative\reg.exe" (
set "SysPath=%SystemRoot%\Sysnative"
set "Path=%SystemRoot%\Sysnative;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%Path%"
)
set "_psc=powershell -nop -c"
set "_buf={$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
set "_err===== ERROR ===="
set "o_x64=684103f5c312ae956e66a02b965d9aad59710745"
set "o_x86=da8f931c7f3bc6643e20063e075cd8fa044b53ae"
set "o_arm=1139ae6243934ca621e6d4ed2e2f34cc130ef88a"
set "_bit=64"
set "_wow=1"
2021-02-15 02:54:12 +01:00
if /i "%PROCESSOR_ARCHITECTURE%"=="amd64" set "xBit=x64"&set "xOS=x64"&set "_orig=%o_x64%"
if /i "%PROCESSOR_ARCHITECTURE%"=="arm64" set "xBit=x86"&set "xOS=A64"&set "_orig=%o_arm%"
if /i "%PROCESSOR_ARCHITECTURE%"=="x86" if "%PROCESSOR_ARCHITEW6432%"=="" set "xBit=x86"&set "xOS=x86"&set "_orig=%o_x86%"&set "_wow=0"&set "_bit=32"
if /i "%PROCESSOR_ARCHITEW6432%"=="amd64" set "xBit=x64"&set "xOS=x64"&set "_orig=%o_x64%"
if /i "%PROCESSOR_ARCHITEW6432%"=="arm64" set "xBit=x86"&set "xOS=A64"&set "_orig=%o_arm%"
2022-05-29 13:00:44 +02:00
reg query HKLM\SYSTEM\CurrentControlSet\Services\WinMgmt /v Start 2>nul | find /i "0x4" 1>nul && (goto :E_WMS)
set _cwmi=0
for %%# in (wmic.exe) do @if not "%%~$PATH:#"=="" (
wmic path Win32_ComputerSystem get CreationClassName /value 2>nul | find /i "ComputerSystem" 1>nul && set _cwmi=1
)
set _pwsh=1
for %%# in (powershell.exe) do @if "%%~$PATH:#"=="" set _pwsh=0
if not exist "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" set _pwsh=0
if %_pwsh% equ 0 goto :E_PWS
2022-05-29 13:00:44 +02:00
set psfull=1
2>nul %_psc% $ExecutionContext.SessionState.LanguageMode | find /i "Full" 1>nul || set psfull=0
if %psfull% equ 0 goto :E_PLM
2022-05-29 13:00:44 +02:00
2021-02-15 02:54:12 +01:00
set _dllPath=%SystemRoot%\System32
if %xOS%==A64 %_psc% $env:PROCESSOR_ARCHITECTURE 2>nul | find /i "x86" 1>nul && set _dllPath=%SystemRoot%\Sysnative
2021-02-15 02:54:12 +01:00
set _dllNum=1
if %xOS%==x64 set _dllNum=2
if %xOS%==A64 set _dllNum=3
set preparedcolor=0
2021-02-15 02:54:12 +01:00
1>nul 2>nul reg query HKU\S-1-5-19 && (
goto :Passed
) || (
if defined _elev goto :E_Admin
)
set _PSarg="""%~f0""" %_args% -elevated
set _PSarg=%_PSarg:'=''%
(1>nul 2>nul cscript //NoLogo "%~f0?.wsf" //job:ELAV /File:"%~f0" %_args% -elevated) && (
exit /b
) || (
call setlocal EnableDelayedExpansion
2019-11-20 01:28:34 +01:00
1>nul 2>nul %SysPath%\WindowsPowerShell\v1.0\%_psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && (
exit /b
) || (
goto :E_Admin
)
)
:Passed
if not exist "%SystemRoot%\Temp\" mkdir "%SystemRoot%\Temp" 1>nul 2>nul
set "_onat=HKLM\SOFTWARE\Microsoft\Office"
set "_owow=HKLM\SOFTWARE\WOW6432Node\Microsoft\Office"
set "_batf=%~f0"
set "_batp=%_batf:'=''%"
set "_utemp=%TEMP%"
2022-10-26 19:52:28 +02:00
set "_Local=%LocalAppData%"
set "_temp=%SystemRoot%\Temp"
set "_log=%~dpn0"
set "_work=%~dp0"
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
2023-09-09 09:53:18 +02:00
:: set _UNC=0
:: if "%_work:~0,2%"=="\\" (
:: set _UNC=1
:: ) else (
:: net use %~d0 %_Null%
:: if not errorlevel 1 set _UNC=1
:: )
for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "_dsk=%%b"
if exist "%PUBLIC%\Desktop\desktop.ini" set "_dsk=%PUBLIC%\Desktop"
set "_mO21a=Detected Office 2021 C2R Retail is activated"
set "_mO19a=Detected Office 2019 C2R Retail is activated"
set "_mO16a=Detected Office 2016 C2R Retail is activated"
set "_mO15a=Detected Office 2013 C2R Retail is activated"
set "_mO21c=Detected Office 2021 C2R Retail could not be converted to Volume"
set "_mO19c=Detected Office 2019 C2R Retail could not be converted to Volume"
set "_mO16c=Detected Office 2016 C2R Retail could not be converted to Volume"
set "_mO15c=Detected Office 2013 C2R Retail could not be converted to Volume"
set "_mO14c=Detected Office 2010 C2R Retail is not supported by KMS_VL_ALL"
set "_mO14m=Detected Office 2010 MSI Retail is not supported by KMS_VL_ALL"
set "_mO15m=Detected Office 2013 MSI Retail is not supported by KMS_VL_ALL"
set "_mO16m=Detected Office 2016 MSI Retail is not supported by KMS_VL_ALL"
set "_mOuwp=Detected Office 365/2016 UWP is not supported by KMS_VL_ALL"
set DO15Ids=ProPlus,Standard,Access,Lync,Excel,Groove,InfoPath,OneNote,Outlook,PowerPoint,Publisher,Word
set DO16Ids=ProPlus,Standard,Access,SkypeforBusiness,Excel,Outlook,PowerPoint,Publisher,Word
set LV16Ids=Mondo,ProPlus,ProjectPro,VisioPro,Standard,ProjectStd,VisioStd,Access,SkypeforBusiness,OneNote,Excel,Outlook,PowerPoint,Publisher,Word
set LR16Ids=%LV16Ids%,Professional,HomeBusiness,HomeStudent,O365Business,O365SmallBusPrem,O365HomePrem,O365EduCloud
set "ESUEditions=Enterprise,EnterpriseE,EnterpriseN,Professional,ProfessionalE,ProfessionalN,Ultimate,UltimateE,UltimateN"
if exist "%SystemRoot%\Servicing\Packages\Microsoft-Windows-Server*Edition~*.mum" (
set "ESUEditions=ServerDatacenter,ServerDatacenterCore,ServerDatacenterV,ServerDatacenterVCore,ServerStandard,ServerStandardCore,ServerStandardV,ServerStandardVCore,ServerEnterprise,ServerEnterpriseCore,ServerEnterpriseV,ServerEnterpriseVCore"
)
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
2023-08-08 04:47:48 +02:00
set UBR=0
if %winbuild% GEQ 7601 for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v UBR 2^>nul') do if not errorlevel 1 set /a UBR=%%b
set _WSH=1
reg query "HKCU\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0)
reg query "HKLM\SOFTWARE\Microsoft\Windows Script Host\Settings" /v Enabled 2>nul | find /i "0x0" 1>nul && (set _WSH=0)
if %_cwmi% EQU 0 if %WMI_PS% EQU 0 if %_WSH% EQU 1 if exist "%SysPath%\vbscript.dll" set WMI_VBS=1
if %_cwmi% EQU 0 if %WMI_VBS% EQU 0 if %_pwsh% EQU 1 set WMI_PS=1
if %_cwmi% EQU 0 if %WMI_VBS% EQU 0 if %WMI_PS% EQU 0 goto :E_WMI
set _acc=WMIC
if %WMI_VBS% NEQ 0 if %WMI_PS% EQU 0 (
if %_WSH% EQU 0 goto :E_WSH
if not exist "%SysPath%\vbscript.dll" goto :E_VBS
set _cwmi=0
set _acc=VBS
)
if %WMI_PS% NEQ 0 (
set _cwmi=0
set WMI_VBS=0
set _acc=PS
)
set "_csg=cscript.exe //NoLogo //Job:WmiMulti "%~nx0?.wsf""
set "_csq=cscript.exe //NoLogo //Job:WmiQuery "%~nx0?.wsf""
set "_csm=cscript.exe //NoLogo //Job:WmiMethod "%~nx0?.wsf""
set "_csp=cscript.exe //NoLogo //Job:WmiPKey "%~nx0?.wsf""
set "_csd=cscript.exe //NoLogo //Job:MPS "%~nx0?.wsf""
set "_csx=cscript.exe //NoLogo //Job:XPDT "%~nx0?.wsf""
set _NCS=1
if %winbuild% LSS 10586 set _NCS=0
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0)
setlocal EnableDelayedExpansion
set "_oem=!_work!"
copy /y nul "!_work!\#.rw" 1>nul 2>nul && (
if exist "!_work!\#.rw" del /f /q "!_work!\#.rw"
) || (
set "_oem=!_dsk!"
set "_log=!_dsk!\%~n0"
if %Logger% EQU 1 set _run="!_dsk!\%~n0_Silent.log"
)
pushd "!_work!"
set "_suf="
call :qrSingle Win32_OperatingSystem LocalDateTime
if %_Debug% EQU 1 if exist "!_log!_Debug.log" (
for /f "tokens=2 delims==." %%# in ('%_qr%') do set "_date=%%#"
set "_suf=_!_date:~8,6!"
)
if %_Debug% EQU 0 (
set "_Nul1=1>nul"
set "_Nul2=2>nul"
set "_Nul6=2^>nul"
set "_Nul3=1>nul 2>nul"
set "_Pause=pause >nul"
if %Unattend% EQU 1 set "_Pause="
if %Silent% EQU 0 (call :Begin) else (call :Begin >!_run! 2>&1)
) else (
set "_Nul1="
set "_Nul2="
set "_Nul6="
set "_Nul3="
set "_Pause="
if %Silent% EQU 0 (
echo.
echo Running in Debug Mode...
if not defined _args (echo The window will be closed when finished) else (echo please wait...)
echo.
echo writing debug log to:
echo "!_log!_Debug!_suf!.log"
)
@echo on
@prompt $G
@call :Begin >"!_log!_tmp.log" 2>&1 &cmd /u /c type "!_log!_tmp.log">"!_log!_Debug!_suf!.log"&del "!_log!_tmp.log"
)
@color 07
@title %ComSpec%
@echo off
@exit /b
:Begin
if %_Debug% EQU 1 (
if defined _args echo %_args%
echo "!_batf!"
)
if exist "%PUBLIC%\ReadMeAIO.html" del /f /q "%PUBLIC%\ReadMeAIO.html"
if exist "%_temp%\'" del /f /q "%_temp%\'"
if exist "%_temp%\`.txt" del /f /q "%_temp%\`.txt"
2019-11-20 01:25:38 +01:00
set _verb=0
set "_wApp=55c92734-d682-4d71-983e-d6ec3f16059f"
set "_oApp=0ff1ce15-a989-479d-af46-f275c6370663"
set "_oA14=59a52881-a989-479d-af46-f275c6370663"
set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"
set "OPPk=SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform"
set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform"
set _Hook="%SysPath%\SppExtComObjHook.dll"
set _Hops=%SysPath%\SppExtComObjHook.dll
set w7inf=%SystemRoot%\Migration\WTR\KMS_VL_ALL.inf
set "_TaskEx=\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger"
set "_TaskOs=\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon"
set "line1============================================================="
set "line2=************************************************************"
set "line3=____________________________________________________________"
set "line4=__________________________________________________"
set SSppHook=0
for /f %%A in ('dir /b /ad %SysPath%\spp\tokens\skus') do (
if %winbuild% GEQ 9200 if exist "%SysPath%\spp\tokens\skus\%%A\*GVLK*.xrm-ms" set SSppHook=1
if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\%%A\*VLKMS*.xrm-ms" set SSppHook=1
if %winbuild% LSS 9200 if exist "%SysPath%\spp\tokens\skus\%%A\*VL-BYPASS*.xrm-ms" set SSppHook=1
)
set OsppHook=1
sc query osppsvc %_Nul3%
if %errorlevel% EQU 1060 set OsppHook=0
set ESU_KMS=0
if %winbuild% LSS 9200 for /f %%A in ('dir /b /ad %SysPath%\spp\tokens\channels') do (
if exist "%SysPath%\spp\tokens\channels\%%A\*VL-BYPASS*.xrm-ms" set ESU_KMS=1
)
if %ESU_KMS% EQU 1 (set "adoff=and LicenseDependsOn is NULL"&set "addon=and LicenseDependsOn is not NULL") else (set "adoff="&set "addon=")
set ESU_EDT=0
if %ESU_KMS% EQU 1 for %%A in (%ESUEditions%) do (
if exist "%SysPath%\spp\tokens\skus\Security-SPP-Component-SKU-%%A\*.xrm-ms" set ESU_EDT=1
)
:: if %ESU_EDT% EQU 1 set SSppHook=1
set ESU_ADD=0
if %winbuild% GEQ 9200 (
set OSType=Win8
set SppVer=SppExtComObj.exe
) else if %winbuild% GEQ 7600 (
set OSType=Win7
set SppVer=sppsvc.exe
) else (
goto :UnsupportedVersion
)
if %OSType% EQU Win8 reg query "%IFEO%\sppsvc.exe" %_Nul3% && (
reg delete "%IFEO%\sppsvc.exe" /f %_Nul3%
call :StopService sppsvc
)
2022-10-26 19:52:28 +02:00
set _uRI=%KMS_RenewalInterval%
set _uAI=%KMS_ActivationInterval%
set _dDbg=No
if %ActWindows% EQU 0 if %ActOffice% EQU 0 set ActWindows=1
if %_Debug% EQU 1 if not defined fAUR set fAUR=0&set External=0
if %Unattend% EQU 1 if not defined fAUR set fAUR=0&set External=0
if not defined fAUR if not defined rAUR goto :MainMenu
if defined rAUR (set _verb=1&cls&call :RemoveHook&goto :cCache)
call :subOffice
set Unattend=1
set _ReAR=0
set _AUR=0
if exist %_Hook% dir /b /al %_Hook% %_Nul3% || (
reg query "%IFEO%\%SppVer%" /v VerifierFlags %_Nul3% && (set _AUR=1) || (reg query "%IFEO%\osppsvc.exe" /v VerifierFlags %_Nul3% && set _AUR=1)
)
if %fAUR% EQU 1 (set _ReAR=1&if %_AUR% EQU 0 (set _AUR=1&set _verb=1&set _rtr=DoActivate&cls&goto :InstallHook) else (set _verb=0&set _rtr=DoActivate&cls&goto :InstallHook))
if %External% EQU 0 (set _AUR=0&cls&goto :DoActivate)
cls&goto :DoActivate
:MainMenu
cls
2022-10-26 19:52:28 +02:00
mode con cols=80 lines=34
color 07
set "_title=KMS_VL_ALL_AIO %uivr%"
title %_title%
call :subOffice
set _dMode=Manual
set _ReAR=0
set _AUR=0
if exist %_Hook% dir /b /al %_Hook% %_Nul3% || (
reg query "%IFEO%\%SppVer%" /v VerifierFlags %_Nul3% && (set _AUR=1&set "_dMode=Auto Renewal") || (reg query "%IFEO%\osppsvc.exe" /v VerifierFlags %_Nul3% && (set _AUR=1&set "_dMode=Auto Renewal"))
)
if %_AUR% EQU 0 (set "_dHook=Not Installed") else (set "_dHook=Installed")
if %ActWindows% EQU 0 (set _dAwin=No) else (set _dAwin=Yes)
if %ActOffice% EQU 0 (set _dAoff=No) else (set _dAoff=Yes)
if %AutoR2V% EQU 0 (set _dArtv=No) else (set _dArtv=Yes)
if %SkipKMS38% EQU 0 (set _dWXKMS=No) else (set _dWXKMS=Yes)
if %_Debug% EQU 0 (set _dDbg=No) else (set _dDbg=Yes)
2022-10-26 19:52:28 +02:00
if %vNextOverride% EQU 0 (set _dNxt=No) else (set _dNxt=Yes)
set _el=
set _quit=
if %preparedcolor%==0 call :colorprep
if %_NCS% EQU 0 (
pushd %_temp%
if not exist "'" (<nul >"'" set /p "=.")
)
echo.
echo %line3%
echo.
rem echo [1] Activate [%_dMode% Mode]
2022-10-26 19:52:28 +02:00
if %_AUR% EQU 1 (
call :Cfgbg %_cWht% " [1] Activate " %_cGrn% "[%_dMode% Mode]"
) else (
call :Cfgbg %_cWht% " [1] Activate " %_cBlu% "[%_dMode% Mode]"
)
echo.
2022-10-26 19:52:28 +02:00
if %_AUR% EQU 1 (
call :Cfgbg %_cWht% " [2] Install Activation Auto-Renewal " %_cGrn% "[%_dHook%]"
) else (
echo [2] Install Activation Auto-Renewal
)
echo [3] Uninstall Completely
echo %line4%
echo.
echo Configuration:
echo.
2022-10-26 19:52:28 +02:00
if %_dDbg%==No (
echo [4] Enable Debug Mode [%_dDbg%]
) else (
2022-10-26 19:52:28 +02:00
call :Cfgbg %_cWht% " [4] Enable Debug Mode " %_cRed% "[%_dDbg%]"
)
if %_dAwin%==Yes (
2022-10-26 19:52:28 +02:00
echo [5] Process Windows [%_dAwin%]
) else (
2022-10-26 19:52:28 +02:00
call :Cfgbg %_cWht% " [5] Process Windows " %_cYel% "[%_dAwin%]"
)
if %_dAoff%==Yes (
2022-10-26 19:52:28 +02:00
echo [6] Process Office [%_dAoff%]
) else (
2022-10-26 19:52:28 +02:00
call :Cfgbg %_cWht% " [6] Process Office " %_cYel% "[%_dAoff%]"
)
if %_dArtv%==Yes (
2022-10-26 19:52:28 +02:00
echo [7] Convert Office C2R-R2V [%_dArtv%]
) else (
2022-10-26 19:52:28 +02:00
call :Cfgbg %_cWht% " [7] Convert Office C2R-R2V " %_cYel% "[%_dArtv%]"
)
if %_dNxt%==No (
if %sub_next% EQU 1 (
call :Cfgbg %_cYel% " [V] Override Office C2R vNext " %_cYel% "[%_dNxt%]"
) else (
echo [V] Override Office C2R vNext [%_dNxt%]
)
) else (
if %sub_next% EQU 1 (
call :Cfgbg %_cYel% " [V] Override Office C2R vNext " %_cRed% "[%_dNxt%]"
) else (
echo [V] Override Office C2R vNext [%_dNxt%]
)
)
if %winbuild% GEQ 10240 (
if %_dWXKMS%==Yes (
2022-10-26 19:52:28 +02:00
echo [X] Skip Windows KMS38 [%_dWXKMS%]
) else (
2022-10-26 19:52:28 +02:00
call :Cfgbg %_cWht% " [X] Skip Windows KMS38 " %_cYel% "[%_dWXKMS%]"
))
echo %line4%
echo.
echo Miscellaneous:
echo.
2022-10-26 19:52:28 +02:00
echo [8] Check Activation Status {vbs}
echo [9] Check Activation Status {wmi}
echo [S] Create $OEM$ Folder
2022-05-29 13:00:44 +02:00
echo [D] Decode Embedded Binary Files
echo [R] Read Me
2022-10-26 19:52:28 +02:00
echo [E] Activate {External Mode}
echo %line3%
echo.
if %_NCS% EQU 0 (
popd
)
2022-10-26 19:52:28 +02:00
choice /c 1234567890EDRSVX /n /m "> Choose a menu option, or press 0 to Exit: "
set _el=%errorlevel%
2022-10-26 19:52:28 +02:00
if %_el%==16 if %winbuild% GEQ 10240 (if %SkipKMS38% EQU 0 (set SkipKMS38=1) else (set SkipKMS38=0))&goto :MainMenu
if %_el%==15 (if %vNextOverride% EQU 0 (set vNextOverride=1) else (set vNextOverride=0))&goto :MainMenu
2022-05-29 13:00:44 +02:00
if %_el%==14 (call :CreateOEM)&goto :MainMenu
if %_el%==13 (call :CreateReadMe)&goto :MainMenu
if %_el%==12 (call :CreateBIN)&goto :MainMenu
if %_el%==11 goto :E_IP
if %_el%==10 (set _quit=1&goto :TheEnd)
2019-11-20 01:21:53 +01:00
if %_el%==9 (call :casWm)&goto :MainMenu
if %_el%==8 (call :casVm)&goto :MainMenu
if %_el%==7 (if %AutoR2V% EQU 0 (set AutoR2V=1) else (set AutoR2V=0))&goto :MainMenu
if %_el%==6 (if %ActOffice% EQU 0 (set ActOffice=1) else (set ActWindows=1&set ActOffice=0))&goto :MainMenu
if %_el%==5 (if %ActWindows% EQU 0 (set ActWindows=1) else (set ActWindows=0&set ActOffice=1))&goto :MainMenu
if %_el%==4 (if %_Debug% EQU 0 (set _Debug=1) else (set _Debug=0))&goto :MainMenu
if %_el%==3 (if %_dDbg%==No (set _verb=1&cls&call :RemoveHook&goto :cCache) else (set _verb=1&cls&goto :RemoveHook))
if %_el%==2 (set _ReAR=1&if %_AUR% EQU 0 (set _AUR=1&set _verb=1&set _rtr=DoActivate&cls&goto :InstallHook) else (set _verb=0&set _rtr=DoActivate&cls&goto :InstallHook))
if %_el%==1 (cls&goto :DoActivate)
goto :MainMenu
:colorprep
set preparedcolor=1
if %_NCS% EQU 1 (
for /f "tokens=1,2 delims=#" %%A in ('"prompt #$H#$E# & echo on & for %%B in (1) do rem"') do set _EC=%%B
set "_cBlu="44;97m""
set "_cRed="40;91m""
set "_cGrn="40;92m""
set "_cYel="40;93m""
set "_cWht="40;37m""
exit /b
)
for /f %%A in ('"prompt $H&for %%B in (1) do rem"') do set "_BS=%%A %%A"
set "_cBlu="1F""
set "_cRed="0C""
set "_cGrn="0A""
set "_cYel="0E""
set "_cWht="07""
exit /b
:Cfgbg
if %_NCS% EQU 1 (
echo %_EC%[%~1%~2%_EC%[%~3%~4%_EC%[0m
exit /b
)
setlocal
set "s=%~2"
set "t=%~4"
call :Pfgbg %1 s %3 t
exit /b
:Pfgbg
setlocal EnableDelayedExpansion
set "s=!%~2!"
set "t=!%~4!"
for /f delims^=^ eol^= %%i in ("!s!") do (
if "!" equ "" setlocal DisableDelayedExpansion
>`.txt (echo %%i\..\')
findstr /a:%~1 /f:`.txt "."
<nul set /p "=%_BS%%_BS%%_BS%%_BS%%_BS%%_BS%%_BS%"
)
setlocal EnableDelayedExpansion
for /f delims^=^ eol^= %%i in ("!t!") do (
if "!" equ "" setlocal DisableDelayedExpansion
>`.txt (echo %%i\..\')
findstr /a:%~3 /f:`.txt "."
<nul set /p "=%_BS%%_BS%%_BS%%_BS%%_BS%%_BS%%_BS%"
)
echo(
exit /b
:E_IP
cls
set kip=
echo.
echo Enter / Paste the external KMS Server address, or just press Enter to return:
echo.
set /p kip=
if not defined kip goto :MainMenu
set "kip=%kip: =%"
set "KMS_IP=%kip%"
set External=1
cls
:DoActivate
if %_dDbg%==Yes (
set "_para=/d"
if %ActWindows% EQU 0 set "_para=!_para! /o"
if %ActOffice% EQU 0 set "_para=!_para! /w"
2022-10-26 19:52:28 +02:00
if %vNextOverride% EQU 0 set "_para=!_para! /v"
if %SkipKMS38% EQU 0 set "_para=!_para! /x"
if %External% EQU 1 set "_para=!_para! /e %KMS_IP%"
if %External% EQU 0 if %_AUR% EQU 0 set "_para=!_para! /m"
if %External% EQU 0 if %_AUR% EQU 1 set "_para=!_para! /a"
goto :DoDebug
)
if %External% EQU 1 (
if "%KMS_IP%"=="%_uIP%" set External=0
)
if %External% EQU 1 (
set _AUR=1
)
if %External% EQU 0 (
set KMS_IP=%_uIP%
)
if %_AUR% EQU 0 (
set KMS_RenewalInterval=43200
set KMS_ActivationInterval=43200
) else (
set KMS_RenewalInterval=%_uRI%
set KMS_ActivationInterval=%_uAI%
)
if %External% EQU 1 (
color 8F&set "mode=External ^(%KMS_IP%^)"
) else (
if %_AUR% EQU 0 (color 1F&set "mode=Manual") else (color 07&set "mode=Auto Renewal")
)
if %Unattend% EQU 0 (
if %_Debug% EQU 0 (title %_title%) else (set "_title=KMS_VL_ALL_AIO %uivr% : %mode%"&title KMS_VL_ALL_AIO %uivr% : %mode%)
) else (
echo.
2019-11-20 01:25:38 +01:00
echo Running KMS_VL_ALL_AIO %uivr%
)
if %Silent% EQU 0 if %_Debug% EQU 0 (
%_Nul3% %_psc% "&%_buf%"
if %Unattend% EQU 0 title %_title%
)
2019-11-20 01:18:43 +01:00
if %winbuild% GEQ 9600 (
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %_Nul3%
if %winbuild% EQU 14393 reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoAcquireGT /t REG_DWORD /d 1 /f %_Nul3%
2019-11-20 01:18:43 +01:00
)
echo.
echo Activation Mode: %mode%
call :StopService sppsvc
if %OsppHook% NEQ 0 call :StopService osppsvc
if %External% EQU 0 if %_ReAR% EQU 0 (set _verb=0&set _rtr=ReturnHook&goto :InstallHook)
:ReturnHook
if %External% EQU 0 if %_AUR% EQU 1 (
call :UpdateIFEOEntry %SppVer%
call :UpdateIFEOEntry osppsvc.exe
)
if %External% EQU 1 if %_AUR% EQU 1 (
call :UpdateOSPPEntry osppsvc.exe
)
SET Win10Gov=0
SET "EditionWMI="
SET "EditionID="