KMS_VL_ALL - Smart Activation Script
- A batch script(s) to automate the activation of supported Windows and Office products using local KMS server emulator or an external server.
- Designed to be unattended and smart enough not to override the permanent activation of products (Windows or Office),
only non-activated products will be KMS-activated (if supported).
- The ultimate feature of this solution when installed, will provide 24/7 activation, whenever the system itself requests it (renewal, reactivation, hardware change, Edition upgrade, new Office...), without needing interaction from the user.
- Some security programs will report infected files due to KMS emulating (see source code near the end),
this is false-positive, as long as you download the file from the trusted Home Page.
- wmic.exe tool is removed from Windows 11 starting build 22483, then added as optional feature starting build 22572.
In case the tool is not available, KMS_VL_ALL v45 and later incorporate simple VBScripts to query and execute WMI functions.
This require Windows Script Host to be working and not disabled.
Furthermore, be advised, this may increase the ratio for marking the script(s) as a security threat.- Home Page:
How does it work?
- Key Management Service (KMS) is a genuine activation method provided by Microsoft for volume licensing customers (organizations, schools or governments).
- By design, the KMS activation period lasts up to 180 Days (6 Months) at max, with the ability to renew and reinstate the period at any time.
With the proper auto renewal configuration, it will be a continuous activation (essentially permanent).
- KMS Emulators (server and client) are sophisticated tools based on the reversed engineered KMS protocol.
It mimics the KMS server/client communications, and provide a clean activation for the supported KMS clients, without altering or hacking any system files integrity.
- Updates for Windows or Office do not affect or block KMS activation, only a new KMS protocol will not work with the local emulator.
- The mechanism of SppExtComObjPatcher makes it act as a ready-on-request KMS server, providing instant activation without external scheduled tasks or manual intervention.
Including auto renewal, auto activation of volume Office afterward, reactivation because of hardware change, date change, windows or office edition change... etc.
On Windows 7, later installed Office may require initiating the first activation vis OSPP.vbs or the script, or opening Office program.
- That feature makes use of the "Image File Execution Options" technique to work, programmed as an Application Verifier custom provider for the system file responsible for the KMS process.
Hence, OS itself handle the DLL injection, allowing the hook to intercept the KMS activation request and write the response on the fly.
On Windows 8.1/10, it also handles the localhost restriction for KMS activation and redirects any local/private IP address as it were external (different stack).
- KMS_VL_ALL scripts make use of Windows Management Instrumentation WMI utilities, which query the properties and executes the methods of Windows and Office licensing classes,
providing a native activation processing, which is almost identical to the official VBScript tools slmgr.vbs and ospp.vbs, but in an automated way.
- The script(s) make these changes to the system (if the emulator is used):
copy or link the file
"C:\Windows\System32\SppExtComObjHook.dll"
add the hook registry keys to"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"
add osppsvc.exe keys to"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform"
create scheduled task"\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger"
(on Windows 8 and later)
Supported Products
Volume-capable:
- Windows 11:
Enterprise, Enterprise LTSC, IoT Enterprise LTSC, Enterprise G, Enterprise multi-session, SE (CloudEdition), Education, Pro, Pro Workstation, Pro Education, Home, Home Single Language, Home China - Windows 10:
Enterprise, Enterprise LTSC/LTSB, Enterprise G, Enterprise multi-session, Education, Pro, Pro Workstation, Pro Education, Home, Home Single Language, Home China - Windows 8.1:
Enterprise, Pro, Pro with Media Center, Core, Core Single Language, Core China, Pro for Students, Bing, Bing Single Language, Bing China, Embedded Industry Enterprise/Pro/Automotive - Windows 8:
Enterprise, Pro, Pro with Media Center, Core, Core Single Language, Core China, Embedded Industry Enterprise/Pro - Windows 10/11 on ARM64 is supported. Windows 8/8.1/10/11 N editions variants are also supported (e.g. Pro N)
- Windows 7:
Enterprise /N/E, Professional /N/E, Embedded POSReady/ThinPC - Windows Server 2022/2019/2016:
LTSC editions (Standard, Datacenter, Essentials, Cloud Storage, Azure Core, Server ARM64), SAC editions (Standard ACor, Datacenter ACor, Azure Datacenter) - Windows Server 2012 R2:
Standard, Datacenter, Essentials, Cloud Storage - Windows Server 2012:
Standard, Datacenter, MultiPoint Standard, MultiPoint Premium - Windows Server 2008 R2:
Standard, Datacenter, Enterprise, MultiPoint, Web, HPC Cluster - Office Volume 2010 / 2013 / 2016 / 2019 / 2021
______________________________
These editions are only KMS-activatable for 45 days at max:
- Windows 10/11 Home edition variants
- Windows 8.1 Core edition variants, Pro with Media Center, Pro for Students
These editions are only KMS-activatable for 30 days at max:
- Windows 8 Core edition variants, Pro with Media Center
Notes:
- supported Windows products do not need volume conversion, only the GVLK (KMS key) is needed, which the script will install accordingly.
- KMS activation on Windows 7 has a limitation related to OEM Activation 2.0 and Windows marker. For more info, see here and here. To verify the activation possibility before attempting, see this.
______________________________
Unsupported Products
- Office MSI Retail 2010/2013, Office 2010 C2R Retail
- Office UWP (Windows 10/11 Apps)
- Windows editions which do not support KMS activation by design:
Windows Evaluation Editions
Windows 7 (Starter, HomeBasic, HomePremium, Ultimate)
Windows 10 (Cloud "S", IoTEnterprise, IoTEnterpriseS, ProfessionalSingleLanguage... etc)
Windows Server (Server Foundation, Storage Server, Home Server 2011... etc)
______________________________
Office C2R 'Your license isn't genuine' notification banner
- Office Click-to-Run builds (since February 2021) that are activated with KMS checks the existence of the KMS server name in the registry.
- If KMS server is not present, a banner is shown in Office programs notifying that "Office isn't licensed properly", see here.
- Therefore in manual mode,
KeyManagementServiceName
value containing an internal private-network IP address 172.16.0.2 will be kept in the below registry keys:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform
- This is perfectly fine to keep, and it does not affect Windows or Office activation.
- Fore more explanation, visit https://infohost.github.io/office-license-is-not-genuine
Office Retail to Volume
Office Retail must be converted to Volume first before it can be activated with KMS
specifically, Office Click-to-Run products, whether installed from ISO (e.g. ProPlus2019Retail.img) or using Office Deployment Tool.
Starting version 36, the activation script implements automatic license conversion for Office C2R.
Notes:
- Supported Click-to-Run products: Office 365 (Microsoft 365 Apps), Office 2021 / 2019 / 2016, Office 2013
- Activated Office Retail or Subscription products will be skipped from conversion
- Office 365 itself does not have volume licenses, therefore it will be converted to Office Mondo licenses
- Windows 10/11: Office 2016 products will be converted with corresponding Office 2019 licenses (if RTM detected)
- Windows 8.1: Office 2016/2019 products will be converted with corresponding Office 2021 licenses (if RTM detected)
- Office Professional suite will be converted with Office Professional Plus licenses
- Office HomeBusiness/HomeStudent suites will be converted with Office Standard licenses
- Office 2013 products follow the same logic, but handled separately
Alternatively, if the automatic conversion did not work, or if you prefer to use the standalone converter script:
Office-C2R-Retail2VolumeYou can also use other tools that can convert licensing:
- OfficeRTool (supports converting and activating Office UWP)
- Office Tool Plus
How To Use
- Remove any other KMS solutions.
- Temporary suspend Antivirus realtime protection, or exclude the downloaded file and the extracted folder from scanning to avoid quarantine.
- If you are using Windows Defender on Windows 11, 10 or 8.1, the script automatically adds an exclusion for
C:\Windows\System32\SppExtComObjHook.dll
therefore, it's best not to disable Windows Defender, and instead exclude the downloaded file and the extracted folder before running the script(s).
- Extract the downloaded file contents to a simple path without special characters or long spaces.
- Administrator rights are required to run the activation script(s).
- KMS_VL_ALL offer 3 flavors of activation modes.
Activation Modes
Auto Renewal
Recommended mode, where you only need to install the activation emulator once. Afterward, the system itself handle and renew activation per schedule.
To run this mode:
- run AutoRenewal-Setup.cmd, press Y to approve the installation
- it will automatically execute Activate.cmd
If you use Antivirus software, make sure to exclude this file from real-time protection:
C:\Windows\System32\SppExtComObjHook.dll
If you later installed Volume Office product(s), it will be auto activated in this mode.
Additionally, If you want to convert and activate Office C2R, renew the activation, or activate new products:
- just run Activate.cmd
On Windows 8 and later, the script duplicate inbox system scheduled task
SvcRestartTaskLogon
toSvcTrigger
this is just a precaution step to insure that the auto renewal period is evaluated and respected, it's not directly related to activation itself, and you can manually remove it.To remove this mode:
- run AutoRenewal-Setup.cmd, press Y to approve the removal
____________________________________________________________
Manual
No remnants mode, where you only need to run Activate.cmd, and then any KMS emulator traces will be cleared from the system.
To run this mode:
- make sure that auto renewal solution is not installed, or remove it
- then, just run Activate.cmd
You will have to run Activate.cmd again to activate newly installed products (e.g. Office) or if Windows edition is switched.
You will have to run Activate.cmd again to activate before the KMS activation period expires.
You can run and activate anytime during that period to renew the period to the max interval.
If Activate.cmd is accidentally terminated before it completes the process, run the script again to clean any leftovers.
____________________________________________________________
External
Standalone mode, where you only need the file Activate.cmd alone, previously refered to as "Online KMS".
You can use Activate.cmd to activate against trusted external KMS server, without needing other files or using local KMS emulator functions.
The external server can be a web address, or a network IP address (local LAN or VM).
To run this mode:
- edit Activate.cmd with Notepad (or text editor)
- change
External=0
to 1 - change
KMS_IP=172.16.0.2
to the IP/address of the server - save the script, and then run
If you later installed Volume Office product(s), it will be auto activated if the external server is still connected.
The used server address will be left registered in the system to allow activated products to auto renew against it,
if the server is no longer available, you will need to run the mode again with a new available server.If you want to clear the server registration and traces, run Activate.cmd in Manual mode once.
or else, use this external script: Clear-KMS-Cache
Additional Options
Activation Choice
Activate.cmd is set by default to process and try to activate both Windows and Office.
However, if you want to turn OFF processing Windows or Office, for whatever reason:
- you afraid it may override permanent activation
- you want to speed up the operation (you have Windows or Office already permanently activated)
- you want to activate Windows or Office later on your terms
To do that:
- edit Activate.cmd with Notepad (or text editor)
- change
ActWindows=1
to zero 0 if tou want to skip Windows - change
ActOffice=1
to zero 0 if you want to skip Office - save the script, and then run
Notice:
this turn OFF is not very effective if Windows or Office installation is already Volume (GVLK installed),
because the system itself may try to reach and KMS activate the products, especially on Windows 8 and later.______________________________
Convert Office C2R-R2V
Activate.cmd is set by default to auto convert detected Office C2R Retail to Volume (except activated Retail products).
However, if you prefer to turn OFF this function:
- edit Activate.cmd with Notepad (or text editor)
- change
AutoR2V=1
to zero 0 - save the script, and then run
______________________________
Skip Windows 10/11 KMS 2038
Activate.cmd is set by default to check and skip Windows activation if KMS 2038 is detected.
However, if you want to revert to normal KMS activation:
- edit Activate.cmd with Notepad (or text editor)
- change
SkipKMS38=1
to zero 0 - save the script, and then run
Notice:
On Windows 10/11, ifSkipKMS38
is ON (default), Windows will always get checked and processed, even ifProcess Windows
is No______________________________
Advanced KMS Options
You can manually modify these KMS-related options by editing Activate.cmd with Notepad before running.
-
KMS_RenewalInterval
Set the interval for KMS auto renewal schedule (default is 10080 = weekly)
this only have much effect on Auto Renewal or External modes
allowed values in minutes: from 15 to 43200
-
KMS_ActivationInterval
Set the interval for KMS reattempt schedule for failed activation renewal, or unactivated products to attemp activation
this does not affect the overall KMS period (180 Days), or the renewal schedule
allowed values in minutes: from 15 to 43200
-
KMS_HWID
Set the Hardware Hash for local KMS emulator server (only affect Windows 8.1/10)
0x prefix is mandatory
-
KMS_Port
Set TCP port for KMS communications
______________________________
Command line Switches
Activate.cmd switches
- Unattended (auto exit):
/u
- Silent run (implies Unattended):
/s
- Silent and create simple log:
/s /L
- Debug mode (implies Unattended):
/d
- Silent Debug mode:
/s /d
- External activation mode:
/e pseudo.kms.server
- Process Windows only:
/w
- Process Office only:
/o
- Turn OFF Office C2R-R2V conversion:
/c
- Do not skip Windows 10/11 KMS38:
/x
AutoRenewal-Setup.cmd switches
- Unattended (auto install or remove and exit):
/u
- Silent run (implies Unattended):
/s
- Silent and create simple log:
/s /L
- Debug mode (implies Unattended):
/d
- Silent Debug mode:
/s /d
- Force installation regardless detection (implies Unattended):
/i
- Force removal regardless detection (implies Unattended):
/r
- Do not clear KMS cache:
/k
Rules:
- All switches are case-insensitive, works in any order, but must be separated with spaces.
- You can specify multiple switches together.
- If Activate.cmd switch
/e
is specified without server address, it will be changed to Manual or Auto (depending on SppExtComObjHook.dll presence).
- If Activate.cmd switches
/o /w
are specified together, the last one takes precedence.
- If AutoRenewal-Setup.cmd switches
/i /r
are specified together, the last one takes precedence.
- Log switch
/L
only works with Silent switch/s
Examples:
Activate.cmd /s /e pseudo.kms.server Activate.cmd /d /w /o Activate.cmd /u /x /e pseudo.kms.server AutoRenewal-Setup.cmd /s /r /k AutoRenewal-Setup.cmd /i /u AutoRenewal-Setup.cmd /s /l
Remarks:
- In general, Windows batch scripts do not work well with unusual folder paths and files name, which contain non-ascii and unicode characters, long paths and spaces, or some of these special characters
` ~ ; ' , ! @ % ^ & ( ) [ ] { } + =
- KMS_VL_ALL scripts are coded to correctly handle those limitations, as much as possible.
- By default, even explorer context menu option "Run as administrator" will fail to execute on some of those paths.
In order to fix that, open command prompt as administrator, then copy/paste and execute these commands:
set _r=^%SystemRoot^% reg add HKLM\SOFTWARE\Classes\batfile\shell\runas\command /f /v "" /t REG_EXPAND_SZ /d "%_r%\System32\cmd.exe /C \"\"%1\" %*\"" reg add HKLM\SOFTWARE\Classes\cmdfile\shell\runas\command /f /v "" /t REG_EXPAND_SZ /d "%_r%\System32\cmd.exe /C \"\"%1\" %*\""
Check Activation Status
You can use those scripts to check the status of Windows and Office products.
Both scripts do not require running as administrator, a double-click to run is enough.
Check-Activation-Status-vbs:
- query and execute official licensing VBScripts: slmgr.vbs for Windows, ospp.vbs for Office
- shows the activation expiration date for Windows
- Office 2010 ospp.vbs shows a very little info
Check-Activation-Status-wmi:
- query and execute WMI functions using wmic.exe or VBScripts
- shows extra more info (SKU ID, key channel)
- shows the activation expiration date for all products
- shows more detailed info for Office 2010
- can show the status of Office UWP apps
- implement vNextDiag.ps1 functions to detect new Office 365 vNext licenses and subscriptions
Setup Preactivate
To preactivate the system during Windows installation, copy
$oem$
folder tosources
folder in the installation installation media (ISO/USB).If you already use another setupcomplete.cmd, rename this one to KMS_VL_ALL.cmd or similar name
then add a command to run it in your setupcomplete.cmd, example:
call KMS_VL_ALL.cmd
Notes:
- The included setupcomplete.cmd is set by default to Auto Renewal mode. You can also change it to External mode
- The included setupcomplete.cmd support the Additional Options described previously, except Command line Switches.
- Later, if you want to uninstall the project, use AutoRenewal-Setup.cmd
- On Windows 8 and later, running setupcomplete.cmd is disabled if the default installed key for the edition is OEM Channel.
Troubleshooting
If the activation failed at first attempt:
- Run Activate.cmd one more time.
- Reboot the system and try again.
- Verify that Antivirus software is not blocking
C:\Windows\SppExtComObjHook.dll
- Check System integrity, open command prompt as administrator, and execute these command respectively:
for Windows 11, 10, or 8.1 only:Dism /online /Cleanup-Image /RestoreHealth
then, for any OS:sfc /scannow
if Auto-Renewal is installed already, but the activation started to fail, run AutoRenewal-Setup.cmd to Uninstall Completely then run it again for installation.
For Windows 7, if you have the errors described in KB4487266, execute the suggested fix.
If you got Error 0xC004F035 on Windows 7, it means your Machine is not qualified for KMS activation. For more info, see here and here.
If you got Error 0x80040154, it is mostly related to misconfigured Windows 10/11 KMS38 activation, rearm the system and start over, or revert to Normal KMS.
If you got Error 0xC004E015, it is mostly related to misconfigured Office retail to volume conversion, try to reinstall system licenses:
cscript //Nologo %SystemRoot%\System32\slmgr.vbs /rilc
If you got one of these Errors on Windows Server, verify that the system is properly converted from Evaluation to Retail/Volume:
0xC004E016 - 0xC004F014 - 0xC004F034If the activation still failed after the above tips, you may enable the debug mode to help determine the reason:
- run Activate.cmd with command line switch:
Activate.cmd /d
- OR
- edit Activate.cmd with Notepad (or text editor)
- change
_Debug=0
to 1 - save the script, and then run
- wait until the operation is finished and Debug.log is created
- upload or post the log file on the home page (MDL forums) for inspection
If you have issues with Office activation, or got undesired or duplicate licenses (e.g. Office 2016 and 2019):
- Download Office Scrubber pack from here.
- To get rid of any conflicted licenses, run Uninstall_Licenses.cmd, then you must start any Office program to repair the licensing.
- You may also try Uninstall_Keys.cmd for similar manner.
- If you wish to remove Office and leftovers completely and start clean:
uninstall Office normally from Control Panel / Programs and Feature
then run Full_Scrub.cmd
afterward, install new Office.
Final tip, you may try to rebuild licensing Tokens.dat as suggested in KB2736303 (this will require to repair Office afterwards).
Source Code
SppExtComObjHookAvrf
https://forums.mydigitallife.net/posts/1508167/
https://app.box.com/s/mztbabp2n21vvjmk57cl1puel0t088bsVisual Studio:
launch shortcut Developer Command Prompt for VS 2017 (or 2019)
execute:
MSBuild SppExtComObjHook.sln /p:configuration="Release" /p:platform="Win32"
MSBuild SppExtComObjHook.sln /p:configuration="Release" /p:platform="x64"
MinGW GCC:
download mingw-w64
Windows x86
Windows x64
both can compile 32-bit and 64-bit binaries
extract and place SppExtComObjHook folder inside mingw32 or mingw64 folder
run_compile.cmd
______________________________
SppExtComObjPatcher
Visual Studio:
https://forums.mydigitallife.net/posts/1457558/
https://app.box.com/s/mztbabp2n21vvjmk57cl1puel0t088bsMinGW GCC:
https://forums.mydigitallife.net/posts/1462101/
Credits
namazso - SppExtComObjHook, IFEO AVrf custom provider.
qad - SppExtComObjPatcher, IFEO Debugger.
Mouri_Naruto - SppExtComObjPatcher-DLL
os51 - SppExtComObjPatcher ported to MinGW GCC, Retail/MAK checks examples.
MasterDisaster - Original script, WMI methods.
Windows_Addict - Features suggestion, ideas, testing, and co-enhancing.
qewpal - KMS-VL-ALL script.
NormieLyfe - GVLK categorize, Office checks help.
rpo, mxman2k, BAU, presto1234 - scripting suggestions.
Nucleus, Enthousiast, s1ave77, l33tisw00t, LostED, Sajjo and MDL Community for interest, feedback and assistance.abbodi1406 - KMS_VL_ALL author
Acknowledgements
MDL forums - the home of the latest and current emulators.
mikmik38 - first reversed source of KMSv5 and KMSv6.
CODYQX4 - easy to use KMSEmulator source.
Hotbird64 - the resourceful vlmcsd tool, and KMSEmulator source development.
cynecx - SECO Injector bypass, SppExtComObj KMS functions.
deagles - SppExtComObjHook Injector.
deagles - KMSServerService.
ColdZero - CZ VM System.
ColdZero - KMS ePID Generator.
kelorgo, bedrock - TAP adapter TunMirror bypass.
mishamosherg - WinDivert FakeClient bypass.
Duser - KMS Emulator fork.
Boops - Tool Ghost KMS (TGK).
ZWT, nosferati87, crony12, FreeStyler, Phazor - KMS Emulator development.