<li>Batch script(s) to automate the activation of supported Windows and Office products using local KMS server emulator, or external server.</li>
</ul>
<ul>
<li>Designed to be unattended and smart enough not to override the permanent activation of products (Windows or Office),<br />
only non-activated products will be KMS-activated (if supported).</li>
</ul>
<ul>
<li>The ultimate feature of this solution when installed, it will provide 24/7 activation, whenever the system itself request it (renewal, reactivation, hardware change, Edition upgrade, new Office...), without needing interaction from user.</li>
</ul>
<ul>
<li>Some security programs will report infected files due KMS emulating (see source code near the end),<br />
this is false-positive, as long as you download the file from the trusted Home Page.</li>
<li>Key Management Service (KMS) is a genuine activation method provided by Microsoft for volume licensing cutomers (organizations, schools or goverments).<br />
The machines in those environments (called KMS clients) activate via the environment KMS host server (authorized Microsoft's licensing key), not via Microsoft activation servers.</li>
<p>For more info, see <a href="https://www.microsoft.com/Licensing/servicecenter/Help/FAQDetails.aspx?id=201#215">here</a> and <a href="https://technet.microsoft.com/en-us/library/ee939272(v=ws.10).aspx#kms-overview">here</a>.</p>
</ul>
<ul>
<li>By design, KMS activation period lasts up to <strong>180 Days</strong> (6 Months) at max, with the ability to renew and reinstate the period at any time.<br />
With the proper auto renewal configuration, it will be a continuous activation (essentially permanent).</li>
</ul>
<ul>
<li>KMS Emulators (server and client) are sophisticated tools based on the reversed engineered KMS protocol.<br />
It mimic the KMS server/client communications, and provide a clean activation for the supported KMS clients, without altering or hacking any system files integrity.</li>
</ul>
<ul>
<li>Updates for Windows or Office do not affect or block KMS activation, only a new KMS protocol will not work with local emulator.<br />
</ul>
<ul>
<li>The mechanism of <strong>SppExtComObjPatcher</strong> make it act as ready-on-request KMS server, providing instant activation without external schedule task or manual intervention.<br />
Incluing auto renewal, auto activation of volume Office afterwards, reactivation because of hardware change, date change, windows or office edition change... etc.</li>
<p>On Windows 7, later installed Office may require initiating the first activation vis OSPP.vbs or the script, or opening Office program.</p>
</ul>
<ul>
<li>That feature make use of "Image File Execution Options" technique to work, programmed as an Application Verifier custom provider for the system file responsible of KMS process.<br />
Hence, OS itself handle the DLL injection, allowing the hook to intercept the KMS activation request and write the response on the fly.</li>
<p>On Windows 8.1/10, it also handle the localhost restriction for KMS activation, and redirect any local/private IP address as it were external (different stack).</p>
</ul>
<ul>
<li>The activation script consist of advanced checks and commands of Windows Management Instrumentation Command <strong>WMIC</strong> utility, that query and execute the methods of Windows and Office licensing classes,<br />
providing a native activation processing, which is almost identical to the official VBScript tools slmgr.vbs and ospp.vbs, but in automated way.</li>
</ul>
<ul>
<li>The script(s) only access 3 parts of the system (if emulator is used):<br />
copy or link the file <code>"C:\Windows\System32\SppExtComObjHook.dll"</code><br />
add the hook registry keys to <code>"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options"</code><br />
add the osppsvc.exe keys to <code>"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform"</code></li>
<li>Windows Editions which do not support KMS activation by design:</li>
Windows Evaluation Editions<br />
Windows 7 (Starter, HomeBasic, HomePremium, Ultimate)<br />
Windows 10 (Cloud "S", IoTEnterprise, IoTEnterpriseS, ProfessionalSingleLanguage... etc)<br />
Windows Server (Server Foundation, Storage Server, Home Server 2011... etc)
</ul>
<p>These editions are only KMS-activatable for <em>45</em> days at max:</p>
<ul>
<li>Windows 10 Home edition variants</li>
<li>Windows 8.1 Core edition variants, Pro with Media Center, Pro Student</li>
</ul>
<p>These editions are only KMS-activatable for <em>30</em> days at max:</p>
<ul>
<li>Windows 8 Core edition variants, Pro with Media Center</li>
</ul>
<p>Notes:</p>
<ul>
<li>supported Windows products do not need volume conversion, only the GVLK (KMS key) is needed, which the script will install accordingly.</li>
<li>KMS activation on Windows 7 have a limitation related to SLIC 2.1 and Windows marker. For more info, see <a href="https://support.microsoft.com/en-us/help/942962">here</a> and <a href="https://technet.microsoft.com/en-us/library/ff793426(v=ws.10).aspx#activation-of-windows-oem-computers">here</a>.</li>
</ul>
<hr />
<br />
<h3><a name="OfficeR2V"></a>Office Retail to Volume</h3>
<p>Office Retail must be converted to Volume first, before it can be activated with KMS<br />
this includes Office C2R 365/2019/2016/2013 installed from default image files (e.g. ProPlus2019Retail.img)</p>
<p>To do so, you need to use this licensing converter script:<br />
<p>Note: only OfficeRTool support converting Office UWP (modern Windows 10 Apps).</p>
<hr />
<br />
<h1><a name="Using"></a>How To Use</h1>
<ul>
<li>Remove any other KMS solutions.</li>
</ul>
<ul>
<li>Temporary suspend Antivirus realtime protection, or exclude the downloaded file and extracted folder from scanning to avoid quarantine.</li>
</ul>
<ul>
<li>Extract the downloaded file contents to a simple path without special characters or long spaces.</li>
</ul>
<ul>
<li>Administrator rights are require to run the activation script(s).</li>
</ul>
<ul>
<li>KMS_VL_ALL offer 3 flavors of activation modes.</li>
</ul>
<hr />
<br />
<h1><a name="Modes"></a>Activation Modes</h1>
<br />
<h2><a name="ModesAut"></a>Auto Renewal</h2>
<p>Recommended mode, where you need to run <strong>Activate.cmd</strong> once, afterwards, the system itself handle and renew activation per schedule.</p>
<p>To get this mode:</p>
<ul>
<li>first, run the script <strong>AutoRenewal-Setup.cmd</strong>, press Y to approve the installation</li>
<li>then, run <strong>Activate.cmd</strong></li>
</ul>
<p>If you use Antivirus software, it is best to exclude this file from scanning protection:<br /><code>C:\Windows\System32\SppExtComObjHook.dll</code></p>
<p>If Windows Defender is enabled on Windows 8.1 or 10, AutoRenewal-Setup.cmd adds the required exclusion upon installation.</p>
<p>Additionally, on Windows 8 and later, AutoRenewal-Setup.cmd <em>duplicate</em> inbox system schedule task <code>SvcRestartTaskLogon</code> to <code>SvcTrigger</code><br />
this is just a precaution step to insure that auto renewal period is evaluated and respected, it's not directly related to activation itself, and you can manually remove it.</p>
<p>If you later installed Volume Office product(s), it will be auto activated in this mode.</p>
<p>You can remove the extracted folder contents, it is not needed after installation.</p>
<p>Run <strong>AutoRenewal-Setup.cmd</strong> again if youwanttoremoveanduninstalltheautorenewalsolution.</p>
<hr />
<br />
<h2><a name="ModesMan"></a>Manual</h2>
<p>Easy mode, where you only need to run <strong>Activate.cmd</strong>, without leaving any KMS emulator traces in the system.</p>
<p>To get this mode:</p>
<ul>
<li>make sure that auto renewal solution is not installed, or remove it</li>
<li>then, just run <strong>Activate.cmd</strong></li>
</ul>
<p>You will have to run <strong>Activate.cmd</strong> again before the KMS activation period expire.</p>
<p>You can run <strong>Activate.cmd</strong> anytime during that period to renew the period to the max interval.</p>
<p>If <strong>Activate.cmd</strong> is accidentally terminated before it completes, run the script again to clean any leftovers.</p>
<hr />
<br />
<h2><a name="ModesExt"></a>External</h2>
<p>Standalone mode, where you only need the file <strong>Activate.cmd</strong> alone, previously refered to as "Online KMS".</p>
<p>You can use <strong>Activate.cmd</strong> to activate against trusted external KMS server, without needing other files or using local KMS emulator functions.</p>
<p>External server can be a web address, or a network IP address (e.g. for local LAN or VM).</p>
<p>To get this mode:</p>
<ul>
<li>run <strong>Activate.cmd</strong> with command line switch <strong>/e</strong> followed by server address, example: <code>Activate.cmd /e pseudo.kms.server</code></li>
<li><strong>OR</strong></li>
<li>edit <strong>Activate.cmd</strong> with Notepad (or text editor)</li>
<li>change <code>External=0</code> to 1</li>
<li>change <code>KMS_IP=172.16.0.2</code> to the IP/address of the server</li>
<li>save the script, and then run</li>
</ul>
<p>If you later installed Volume Office product(s), it will be auto activated if the external server is still available</p>
<p>The used server address will be left registered in the system to allow activated products to auto renew against the external server if it is still available,<br />
otherwise, you need another manual run against new available server.</p>
<p>If you want to clean the server registration, run <strong>Activate.cmd</strong> in Manual mode once.<br />
or else, use this external script: <a href="https://github.com/abbodi1406/WHD/raw/master/scripts/Clear-KMS-Cache-20190329.zip">Clear-KMS-Cache</a></p>
<li>query and execute native WMI functions, no vbscripting involved</li>
<li>it show extra more info (SKU ID, key channel)</li>
<li>it does not show expiration date for Windows</li>
<li>it show more detailed info for Office 2010</li>
<li>it can show status of Office UWP apps</li>
</ul>
<hr />
<br />
<h2><a name="Setup"></a>Setup Preactivate</h2>
<p>To preactivate the system during installation, copy <code>$oem$</code> folder to <code>sources</code> folder in the installation media (iso/usb).</p>
<p>If you already use another <strong>setupcomplete.cmd</strong>, rename this one to <strong>KMS_VL_ALL.cmd</strong> or similar name<br />
then add a command to run it in your setupcomplete.cmd, example:<br />
<code>call KMS_VL_ALL.cmd</code></p>
<p>Use <strong>AutoRenewal-Setup.cmd</strong> if you want to uninstall the project afterwards.</p>
<p>Notes:</p>
<ul>
<li>The included <strong>setupcomplete.cmd</strong> support the <em>Additional Options</em> described previously, except Unattended Switches.</li>
<li>Use <strong>AutoRenewal-Setup.cmd</strong> if you want to uninstall the project afterwards.</li>
<li>In Windows 8 and later, running setupcomplete.cmd is disabled if the default installed key for the edition is OEM Channel.</li>
</ul>
<hr />
<br />
<h2><a name="Debug"></a>Troubleshooting</h2>
<p>If the activation failed at first run:</p>
<ul>
<li>Run <strong>Activate.cmd</strong> one more time.</li>
<li>Reboot the system and try again.</li>
<li>Check that Antivirus software is not blocking "C:\Windows\SppExtComObjHook.dll".</li>
<li>Check System integrity, open command prompt as administrator, and execute these command respectively:<br />
for Windows 8.1 and 10 only: <code>Dism /online /Cleanup-Image /RestoreHealth</code><br />
then, for any OS: <code>sfc /scannow</code></li>
</ul>
<p>For Windows 7, if have the errors described in <a href="https://support.microsoft.com/en-us/help/4487266">KB4487266</a>, execute the suggested fix.</p>
<p>If you got Error <strong>0xC004F035</strong> on Windows 7, it means your Machine is not qualified for KMS activation. For more info, see <a href="https://support.microsoft.com/en-us/help/942962">here</a> and <a href="https://technet.microsoft.com/en-us/library/ff793426(v=ws.10).aspx#activation-of-windows-oem-computers">here</a>.</p>
<p>If you got Error <strong>0x80040154</strong>, it is mostly related to misconfigured Windows 10 KMS38 activation, rearm the system and start over, or revert to Normal KMS.</p>
<p>If you got Error <strong>0xC004E015</strong>, it is mostly related to misconfigured Office retail to volume conversion, try to reinstall system licenses:<br /><code>cscript //Nologo %SystemRoot%\System32\slmgr.vbs /rilc</code></p>
<p>If you got one of these Errors on Windows Server, verify that the system is properly converted from Evaluation to Retail/Volume:<br /><strong>0xC004E016</strong> - <strong>0xC004F014</strong> - <strong>0xC004F034</strong></p>
<p>If the activation still failed after the above tips, you may enable the debug mode to help determine the reason:</p>
<ul>
<li>run <strong>Activate.cmd</strong> with command line switch: <code>Activate.cmd /d</code></li>
<li><strong>OR</strong></li>
<li>edit <strong>Activate.cmd</strong> with Notepad (or text editor)</li>
<li>change <code>_Debug=0</code> to 1</li>
<li>save the script, and then run</li>
<li>wait until command prompt window is closed and Debug.log is created</li>
<li>upload or post the log file on the home page (MDL forums) for inspection</li>
</ul>
<p>Final tip, you may try to rebuild licensing Tokens.dat as suggested in <a href="https://support.microsoft.com/en-us/help/2736303">KB2736303</a> (this may require you to repair Office afterwards).</p>
<a href="https://forums.mydigitallife.net/members/80361/">Nucleus</a>, <a href="https://forums.mydigitallife.net/members/104688/">Enthousiast</a>, <a href="https://forums.mydigitallife.net/members/293479/">s1ave77</a>, <a href="https://forums.mydigitallife.net/members/325887/">l33tisw00t</a>, <a href="https://forums.mydigitallife.net/members/77147/">LostED</a>, <a href="https://forums.mydigitallife.net/members/1023044/">Sajjo</a> and MDL Community for interest, feedback and assistance.</p>