====================================================================================================
   KMS38 Activation:
====================================================================================================

 - This activation method activates Windows 10/11 and Windows Server (14393 and later builds), 
   until the year 2038.
 - This activation method does not store any files on the system.

 - Make sure the following things have been accounted for, before applying KMS38 Activation:
   - Before the activation, if any KMS activator is installed, then make sure to uninstall it 
     completely.
   - After KMS38 activation for the Windows Operating System has been achieved, if you want to 
     additionally, use the 180 Days KMS Activator for MS Office, then you must make sure that 
     it (the 180 Days KMS Activator for MS Office) is compatible with Windows KMS38 activation. 
     FYI, the following activators are compatible and can activate Office 
     without disrupting the Windows KMS38 activation.

     KMS_VL_ALL by @abbodi1406     https://forums.mydigitallife.net/posts/838808
     Online KMS Activation Script  https://massgrave.dev

 - Any KMS Activator which is not compatible with KMS38, may overwrite the KMS38 activation for 
   Windows with its own 180 days activation, thereby destroying the KMS38 activation for Windows. 
   To prevent this accidental overwriting, you can apply KMS38 protection for Windows, check 
   the Extras folder for more details.

 - Why is the script setting the specific KMS host to 127.0.0.2 (localhost)?
   - By doing this, global KMS IP can not replace KMS38 activation but can be used with Office and
     other Windows Editions.
   - In case you don't like it, you can remove it with following codes, open CMD as admin and enter,

reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" /f
reg delete "HKU\S-1-5-20\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f" /f

 - Check Troubleshoot Script in the "Extras" section if you are facing issues with activation.

 - Check Extract OEM option in the "Extras" section if you want pre-activated Windows installation.

 - Further read on how it KMS38 activation works: https://massgrave.dev/readme-activation-faq.html
 
====================================================================================================
   Supported Products:
====================================================================================================

   Windows 10/11:

   Generic Volume License Key       Edition      

   NPPR9-FWDCX-D2C8J-H872K-2YT43    Enterprise
   DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4    EnterpriseN
   W269N-WFGWX-YVC9B-4J6C9-T83GX    Professional
   MH37W-N47XK-V7XM9-C7227-GCQG9    ProfessionalN
   3KHY7-WNT83-DGQKR-F7HPR-844BM    CoreN
   PVMJN-6DFY6-9CCP6-7BKTT-D3WVR    CoreCountrySpecific
   7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH    CoreSingleLanguage
   TX9XD-98N7V-6WMQ6-BX7FG-H8Q99    Core
   NW6C2-QMPVW-D7KKK-3GKT6-VCFB2    Education
   2WH4N-8QGBV-H22JP-CT43Q-MDWWJ    EducationN
   M7XTQ-FN8P6-TTKYV-9D4CC-J462D    EnterpriseS_RS5,VB       [LTSC 2019,2021]
   DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ    EnterpriseS_RS1          [LTSB 2016]
   WNMTR-4C88C-JK8YV-HQ7T2-76DF9    EnterpriseS_TH1          [LTSB 2015]
   92NFX-8DJQP-P6BBQ-THF9C-7CG2H    EnterpriseSN_RS5,VB      [LTSC N 2019,2021]
   QFFDN-GRT3P-VKWWX-X7T3R-8B639    EnterpriseSN_RS1         [LTSB N 2016]
   2F77B-TNFGY-69QQF-B8YKP-D69TJ    EnterpriseSN_TH1         [LTSB N 2015]
   NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J    ProfessionalWorkstation
   9FNHH-K3HBT-3W4TD-6383H-6XYWF    ProfessionalWorkstationN
   6TP4R-GNPTD-KYYHQ-7B7DP-J447Y    ProfessionalEducation
   YVWGF-BXNMC-HTQYQ-CPQ99-66QFC    ProfessionalEducationN
   YYVX9-NTFWV-6MDM3-9PT4T-4M68B    EnterpriseG
   44RPN-FTY23-9VTTB-MP9BX-T84FV    EnterpriseGN
   CPWHC-NT2C7-VYW78-DHDB2-PG3GK    ServerRdsh_RS5
   7NBT4-WGBQX-MP4H7-QXFF8-YP3KX    ServerRdsh_RS3
   NBTWJ-3DR69-3C4V8-C26MC-GQ9M6    CloudE
   6XN7V-PCBDC-BDBRH-8DQY7-G6R44    CloudEditionN
   37D7F-N49CB-WQR8W-TBJ73-FM8RX    CloudEdition
								    
   Windows Server:                  
								    
   VDYBN-27WPP-V4HQT-9VMD4-VMK7H    ServerStandard_FE
   N69G4-B89J2-4G8F4-WWYCC-J464C    ServerStandard_RS5
   WC2BQ-8NRM3-FDDYY-2BFGV-KHKQY    ServerStandard_RS1
   WX4NM-KYWYW-QJJR4-XV3QB-6VM33    ServerDatacenter_FE
   WMDGN-G9PQG-XVVXX-R3X43-63DFG    ServerDatacenter_RS5
   CB7KF-BWN84-R7R2Y-793K2-8XDDG    ServerDatacenter_RS1
   WVDHN-86M7X-466P6-VHXV7-YY726    ServerSolution_RS5
   JCKRF-N37P4-C2D82-9YXRT-4M63B    ServerSolution_RS1
   QN4C6-GBJD2-FB422-GHWJK-GJG2R    ServerCloudStorage
   GRFBW-QNDC4-6QBHG-CCK3B-2PR88    ServerARM64_RS5
   K9FYF-G6NCK-73M32-XMVPY-F9DRR    ServerARM64_RS4
   QFND9-D3Y9C-J3KKY-6RPVP-2DPYV    ServerDatacenterACor_FE
   6NMRW-2C8FM-D24W7-TQWMY-CWH2D    ServerDatacenterACor_RS5
   2HXDN-KRXHB-GPYC7-YCKFJ-7FVDG    ServerDatacenterACor_RS3
   67KN8-4FYJW-2487Q-MQ2J7-4C4RG    ServerStandardACor_FE
   N2KJX-J94YW-TQVFB-DG9YT-724CC    ServerStandardACor_RS5
   PTXN8-JFHJM-4WC78-MPCBR-9W4KR    ServerStandardACor_RS3
   6N379-GGTMK-23C6M-XVVTC-CKFRQ    ServerAzureCor_FE
   FDNH6-VW9RW-BXPJ7-4XTYG-239TB    ServerAzureCor_RS5
   VP34G-4NPPG-79JTQ-864T4-R3MQX    ServerAzureCor_RS1
   NTBV8-9K7Q8-V27C6-M2BTV-KHMXV    ServerTurbine


   Note - X86-X64 and ARM64 architecture systems are supported.
        - Any Evaluation version of Windows and Server (i.e. 'EVAL' LTSB/C) cannot be activated.
        - KMS38 only supports Windows/server version 14393 (1607) and newer versions.

====================================================================================================
   KMS38 Protection:
====================================================================================================
   
 - By default, a KMS38 Activation is vulnerable to unintended overwriting/replacement and 
   neutralization by a 180-Day KMS Activator (non-KMS38 Activator).

   If you are going to use KMS_VL_ALL or MAS's KMS activation for Office,
   then you don't need to enable this protection.

   However, with a few tricks you can ensure that no alternative KMS Activator can replace KMS38 
   Activation by accident or even on purpose. This script demonstrate how to do/undo that.

 - Protect KMS38:
   - How does KMS38 Protection work?
     In the KMS activation method, the Windows Operating System first checks the KMS IP registered 
     as a specific KMS, and if that is not defined then it checks the Global KMS IP.
     Another fact is that if LocalHost (127.0.0.2) is defined as KMS IP in the Windows 8.1 and 10 OS's
     then Windows will not accept it as a valid KMS IP.
     This script simply utilizes the above facts to protect the KMS38 activation from being 
     overwritten by any alternative 'normal' 180-Day KMS Activation.

     Script steps-
     - Set that Windows edition specific KMS IP to LocalHost (127.0.0.2),
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\55c92734-d682-4d71-983e-d6ec3f16059f\XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
where X is Windows edition Activation ID.

     - Lock this Registry with Reg_takeownership snippet by @AveYo aka @BAU
       pastebin.com/XTPt0JSC
     - Done.
   
====================================================================================================
   Switches for the Script (Separate Files Version):
====================================================================================================

 - To run the script in unattended mode, use /u parameter.
"KMS38_Activation.cmd" /a

 - To activate along with KMS38 protection (from being replaced by 180 days KMS activation), 
   run the script with /ap parameter
"KMS38_Activation.cmd" /ap

 - To only generate GenuineTicket.xml, run the script with /g parameter
"KMS38_Activation.cmd" /g

 - To uninstall the KMS38, run the script with /x parameter
"KMS38_Activation.cmd" /x

====================================================================================================
   File Details:
====================================================================================================

   https://massgrave.dev/readme-hwid-kms38-files.html

====================================================================================================
   Manual Activation Process:
====================================================================================================

 - Prerequisite:

   For Windows 10 / Server x86-x64 system, you need following files (Get it from MAS separate files version)
   
   ClipUp.exe
   gatherosstate.exe
   slc.dll

   * ClipUp.exe is only required to activate Server Cor and Acor editions.

   For Windows 10 ARM64 system, you need following files,
   arm64_gatherosstate.exe
   arm64_slc.dll
   * Rename the ARM64 files to gatherosstate.exe and slc.dll respectively.

   Make a folder named 'Files' in C drive, [C:\Files] and copy the required files in that folder.

   -------------------------------------------------------------------------------------------------

 - Make sure to properly and completely remove any previously-installed KMS activator if one already exists.
 - Open CMD as Admin, and enter the following listed commands in the sequence in which they are given.
 - Enter Generic Volume License Key (GVLK) (Replace '%key%' with the key from the above list) 
   with the following command:
   
cscript /nologo %windir%\system32\slmgr.vbs /ipk %key%

 - Set specific KMS host to 127.0.0.2 [Localhost] with the following command: (Run one by one)
   - By doing this, the global KMS IP can not replace the KMS38 activation, and can then safely be used with MS Office 
     and other Windows Editions.
   - It's optional.

for /f "tokens=2 delims==" %G in ('"wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%' and Name like 'Windows%%' and PartialProductKey is not NULL) get ID /VALUE"') do (set app=%G)
wmic path SoftwareLicensingProduct where ID='%app%' call ClearKeyManagementServiceMachine
wmic path SoftwareLicensingProduct where ID='%app%' call ClearKeyManagementServicePort
wmic path SoftwareLicensingProduct where ID='%app%' call SetKeyManagementServiceMachine MachineName="127.0.0.2"
wmic path SoftwareLicensingProduct where ID='%app%' call SetKeyManagementServicePort 1688

 - Make sure slc.dll and gatherosstate.exe files are located in the folder, "C:\Files" and enter 
   following command to generate GenuineTicket.xml file.

call "C:\Files\gatherosstate.exe"

 - Now a GenuineTicket.xml file should be created in the folder "C:\Files\", copy and paste this file in the 
   folder named, "C:\ProgramData\Microsoft\Windows\ClipSVC\GenuineTicket\"

 - Now apply this ticket using the following commands in this sequence:
   (In case of server cor and acor editions, copy the clipup.exe file to the folder "C:\Windows\System32\")

net stop ClipSVC
net start ClipSVC

 - Check the expiry date of the activation with the following command: 

cscript /nologo %windir%\system32\slmgr.vbs /xpr

 - If the expiry date is not in the year 2038, then enter the following command: 

cscript /nologo %windir%\system32\slmgr.vbs /rearm-app 55c92734-d682-4d71-983e-d6ec3f16059f
for /f "tokens=2 delims==" %G in ('"wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%' and Name like 'Windows%%' and PartialProductKey is not NULL) get ID /VALUE"') do (set app=%G)
cscript /nologo %windir%\system32\slmgr.vbs /rearm-sku %app%

 - check expiry date again, now it should show activation until the year 2038.

 - Done.

   * Note - [clipup -v -o -altto ] method to apply the ticket was not suggested because
            of the issues in case the username have spaces or non English characters.

=========================================================================================================
   Credits:
=========================================================================================================

   @mspaintmsi   Original co-authors of HWID/KMS38 Activation without KMS or predecessor install/upgrade
        &        Various methods of ticket generation and improvements for slc.dll
   *Anonymous    nsaneforums.com/topic/316668--/?do=findComment&comment=1497887

   @qxkqf        ARM64 port of @mspaintmsi's slc.dll 


   Acknowledgements:

   @vyvojar      slshim
                 github.com/vyvojar/slshim/releases

   @sponpa       New ideas for the HWID/KM38 Generation
                 nsaneforums.com/topic/316668--/page/21/?tab=comments#comment-1431257

   @leitek8      Improvements for the slc.dll
                 nsaneforums.com/topic/316668--/page/22/?tab=comments#comment-1438005

   Source codes collection:
   app.box.com/s/y71tpcamofcg6zv6k7by6gaex6om3q4d
_______________________________________

   Kind help and snippets:

   @BAU          Reg_own lean and mean snippet
                 pastebin.com/XTPt0JSC

                 Compressed2TXT
                 github.com/AveYo/Compressed2TXT

   Scripting help:
   @RPO, @BAU, @abbodi1406

   ARM64 testing:
   @Imoagn, @moderate, @Chibi ANUBIS, @smashed

   English grammar fix:
   @BorrowedWifi

   Thanks for resolving my queries:
   @awuctl, @sponpa, @leitek8, @mxman2k, @mspaintmsi, @Yen, @BAU, @RPO, @abbodi1406

_______________________________________

   Microsoft Activation Scripts:

  Homepage: massgrave.dev
     Email: windowsaddict@protonmail.com

=========================================================================================================