diff --git a/$OEM$/$$/Setup/Scripts/Win32/SppExtComObjHook.dll b/$OEM$/$$/Setup/Scripts/Win32/SppExtComObjHook.dll index b77adc3..bab793a 100644 Binary files a/$OEM$/$$/Setup/Scripts/Win32/SppExtComObjHook.dll and b/$OEM$/$$/Setup/Scripts/Win32/SppExtComObjHook.dll differ diff --git a/$OEM$/$$/Setup/Scripts/Win32/key.cmd b/$OEM$/$$/Setup/Scripts/Win32/key.cmd index 7ed6330..1182887 100644 --- a/$OEM$/$$/Setup/Scripts/Win32/key.cmd +++ b/$OEM$/$$/Setup/Scripts/Win32/key.cmd @@ -1,5 +1,5 @@ if "%~1"=="" exit /b -goto :%1 || exit /b +goto :%1 2>nul || exit /b :: Windows 10 [RS5] :32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee diff --git a/$OEM$/$$/Setup/Scripts/setupcomplete.cmd b/$OEM$/$$/Setup/Scripts/setupcomplete.cmd index 3d75250..5562c2d 100644 --- a/$OEM$/$$/Setup/Scripts/setupcomplete.cmd +++ b/$OEM$/$$/Setup/Scripts/setupcomplete.cmd @@ -5,13 +5,6 @@ set KMS_Port=1688 set KMS_ActivationInterval=120 set KMS_RenewalInterval=10080 set KMS_HWID=0x3A1C049600B60076 -set Windows=Random -set Office2010=Random -set Office2013=Random -set Office2016=Random -set Office2019=Random - -set FixedEPID=1 set "SysPath=%Windir%\System32" if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative") @@ -28,8 +21,9 @@ WMIC PATH %spp% WHERE LicenseStatus=1 GET Name 2>nul | findstr /i "Windows" >nul set "_tempdir=%SystemRoot%\Temp" set "_workdir=%~dp0" +if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%" set xOS=x64 -if /i %PROCESSOR_ARCHITECTURE%==x86 (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32) +if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32) setlocal EnableExtensions EnableDelayedExpansion set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" set "OSPP=HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" @@ -73,8 +67,10 @@ SET EditionID=%EditionWMI% :Main call :StopService sppsvc if %OsppHook% NEQ 0 call :StopService osppsvc -if exist "%SystemRoot%\system32\SppExtComObjPatcher.*" del /f /q "%SystemRoot%\system32\SppExtComObjPatcher.*" >nul 2>&1 -copy /y "!_workdir!\!xOS!\SppExtComObjHook.dll" "%SystemRoot%\system32" >nul 2>&1 +for %%# in (SppExtComObjHookAvrf.dll,SppExtComObjHook.dll,SppExtComObjPatcher.dll,SppExtComObjPatcher.exe) do ( + if exist "%SystemRoot%\system32\%%#" del /f /q "%SystemRoot%\system32\%%#" >nul 2>&1 +) +copy /y "!_workdir!\!xOS!\SppExtComObjHook.dll" "%SystemRoot%\system32" >nul 2>&1 || exit /b if %OSType% EQU Win8 call :CreateIFEOEntry SppExtComObj.exe if %OSType% EQU Win7 if %SppHook% NEQ 0 call :CreateIFEOEntry sppsvc.exe call :CreateIFEOEntry osppsvc.exe @@ -83,12 +79,12 @@ if not defined _C2R reg query HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\ClickTo for %%A in (14,15,16,19) do call :officeLoc %%A call :SPP call :OSPP -if %FixedEPID%==1 call :ePID if %winbuild% GEQ 9200 ( schtasks /query /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" 1>nul 2>nul || schtasks /create /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" /xml "%~dp0Win32\SvcTrigger.xml" /f >nul 2>&1 ) attrib -R -A -S -H *.* if exist "!_tempdir!\*chk.txt" del /f /q "!_tempdir!\*chk.txt" +if exist "!_tempdir!\slmgr.vbs" del /f /q "!_tempdir!\slmgr.vbs" exit /b :StopService @@ -97,23 +93,19 @@ sc query %1 | find /i "STOPPED" >nul || sc stop %1 >nul 2>&1 goto :eof :CreateIFEOEntry -reg add "%IFEO%\%1" /f /v Debugger /t REG_SZ /d "rundll32.exe SppExtComObjHook.dll,PatcherMain" >nul 2>&1 +reg delete "%IFEO%\%1" /f /v Debugger >nul 2>&1 +reg add "%IFEO%\%1" /f /v VerifierDlls /t REG_SZ /d "SppExtComObjHook.dll" >nul 2>&1 +reg add "%IFEO%\%1" /f /v GlobalFlag /t REG_DWORD /d 256 >nul 2>&1 reg add "%IFEO%\%1" /f /v KMS_Emulation /t REG_DWORD /d %KMS_Emulation% >nul 2>&1 reg add "%IFEO%\%1" /f /v KMS_ActivationInterval /t REG_DWORD /d %KMS_ActivationInterval% >nul 2>&1 reg add "%IFEO%\%1" /f /v KMS_RenewalInterval /t REG_DWORD /d %KMS_RenewalInterval% >nul 2>&1 -if /i %1 NEQ osppsvc.exe ( -reg add "%IFEO%\%1" /f /v Windows /t REG_SZ /d "%Windows%" >nul 2>&1 -if %winbuild% GEQ 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" >nul 2>&1 +if /i %1 EQU SppExtComObj.exe if %winbuild% GEQ 9600 ( +reg add "%IFEO%\%1" /f /v KMS_HWID /t REG_QWORD /d "%KMS_HWID%" >nul 2>&1 ) if /i %1 EQU osppsvc.exe ( -reg add "%IFEO%\%1" /f /v Office2010 /t REG_SZ /d "%Office2010%" >nul 2>&1 -if %winbuild% LSS 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" >nul 2>&1 reg add "%OSPP%" /f /v KeyManagementServiceName /t REG_SZ /d %KMS_IP% >nul 2>&1 reg add "%OSPP%" /f /v KeyManagementServicePort /t REG_SZ /d %KMS_Port% >nul 2>&1 ) -if /i %1 EQU SppExtComObj.exe if %winbuild% GEQ 9600 ( -reg add "%IFEO%\%1" /f /v KMS_HWID /t REG_QWORD /d "%KMS_HWID%" >nul 2>&1 -) goto :eof :SPP @@ -184,8 +176,26 @@ call :winchk exit /b :winchk -wmic path %spp% where (LicenseStatus='1' and Description like '%%KMSCLIENT%%') get Name 2>nul | findstr /i "Windows" >nul 2>&1 && (exit /b) -wmic path %spp% where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name 2>nul | findstr /i "Windows" >nul 2>&1 && (set WinPerm=1&exit /b) +if not defined tok (if %winbuild% GEQ 9200 (set "tok=4") else (set "tok=7")) +if not defined wApp set wApp=55c92734-d682-4d71-983e-d6ec3f16059f +wmic path %spp% where (LicenseStatus='1' and Description like '%%KMSCLIENT%%') get Name 2>nul | findstr /i "Windows" 1>nul && (exit /b) +echo. +wmic path %spp% where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name 2>nul | findstr /i "Windows" 1>nul && ( +set WinPerm=1 +) +if not defined WinPerm ( +wmic path %spp% where "ApplicationID='%wApp%' and LicenseStatus='1'" get Name 2>nul | findstr /i "Windows" 1>nul && ( +for /f "tokens=%tok% delims=, " %%G in ('"wmic path %spp% where (ApplicationID='%wApp%' and LicenseStatus='1') get Description /VALUE"') do set "channel=%%G" + for %%A in (VOLUME_MAK, RETAIL, OEM_DM, OEM_SLP, OEM_COA, OEM_COA_SLP, OEM_COA_NSLP, OEM_NONSLP, OEM) do if /i "%%A"=="!channel!" set WinPerm=1 + ) +) +if not defined WinPerm ( +copy /y %Windir%\System32\slmgr.vbs "!_tempdir!\slmgr.vbs" 1>nul +cscript //nologo "!_tempdir!\slmgr.vbs" /xpr 2>nul | findstr /i "permanently" 1>nul && set WinPerm=1 +) +if defined WinPerm ( +exit /b +) call :insKey %app% exit /b @@ -416,47 +426,3 @@ wmic path %spp% where ID='%1' call ClearKeyManagementServicePort >nul 2>&1 wmic path %spp% where ID='%1' call Activate >nul 2>&1 if /i %sps% EQU SoftwareLicensingService wmic path %sps% where version='%ver%' call RefreshLicenseStatus >nul 2>&1 exit /b - -:ePID -set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" -for %%A in (WINEPID,O14EPID,O15EPID,O16EPID,O19EPID,WINRAND,O14RAND,O15RAND,O16RAND,O19RAND) do set %%A=0 -if %winbuild% LSS 9200 ( -set "winkey=sppsvc.exe" -set "o15key=osppsvc.exe" -set "o14key=osppsvc.exe" -set "o15svc=OfficeSoftwareProtectionProduct" -set "o14svc=OfficeSoftwareProtectionProduct" -) else ( -set "winkey=SppExtComObj.exe" -set "o15key=SppExtComObj.exe" -set "o14key=osppsvc.exe" -set "o15svc=SoftwareLicensingProduct" -set "o14svc=OfficeSoftwareProtectionProduct" -) -reg query "%IFEO%\%winkey%" /v Windows 2>nul | findstr /i Random 1>nul && set WINRAND=1 -reg query "%IFEO%\%o14key%" /v Office2010 2>nul | findstr /i Random 1>nul && set O14RAND=1 -reg query "%IFEO%\%o15key%" /v Office2013 2>nul | findstr /i Random 1>nul && set O15RAND=1 -reg query "%IFEO%\%o15key%" /v Office2016 2>nul | findstr /i Random 1>nul && set O16RAND=1 -reg query "%IFEO%\%o15key%" /v Office2019 2>nul | findstr /i Random 1>nul && set O19RAND=1 - -if defined WinVL if not defined WinPerm if %WINRAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%' AND Name like 'Windows%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "WINEPID=%%A" -echo !WINEPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%winkey%" /f /v Windows /t REG_SZ /d "!WINEPID!" 1>nul 2>nul) -) -if %loc_off19% equ 1 if %O19RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Name like '%%KMS_Client_AE%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O19EPID=%%A" -echo !O19EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o15key%" /f /v Office2019 /t REG_SZ /d "!O19EPID!" 1>nul 2>nul) -) -if %loc_off16% equ 1 if %O16RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 16%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O16EPID=%%A" -echo !O16EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o15key%" /f /v Office2016 /t REG_SZ /d "!O16EPID!" 1>nul 2>nul) -) -if %loc_off15% equ 1 if %O15RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 15%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O15EPID=%%A" -echo !O15EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o15key%" /f /v Office2013 /t REG_SZ /d "!O15EPID!" 1>nul 2>nul) -) -if %loc_off14% equ 1 if %O14RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o14svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 14%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" 2^>nul') do set "O14EPID=%%A" -echo !O14EPID!| findstr /i "\-" 1>nul && (reg add "%IFEO%\%o14key%" /f /v Office2010 /t REG_SZ /d "!O14EPID!" 1>nul 2>nul) -) -exit /b \ No newline at end of file diff --git a/$OEM$/$$/Setup/Scripts/x64/SppExtComObjHook.dll b/$OEM$/$$/Setup/Scripts/x64/SppExtComObjHook.dll index ac86d1a..6d22339 100644 Binary files a/$OEM$/$$/Setup/Scripts/x64/SppExtComObjHook.dll and b/$OEM$/$$/Setup/Scripts/x64/SppExtComObjHook.dll differ diff --git a/1-SppExtComObjPatcher.cmd b/1-SppExtComObjPatcher.cmd index b662292..860c7e4 100644 --- a/1-SppExtComObjPatcher.cmd +++ b/1-SppExtComObjPatcher.cmd @@ -1,5 +1,4 @@ @echo off -cls set ClearKMSCache=1 set KMS_Emulation=1 @@ -8,11 +7,6 @@ set KMS_Port=1688 set KMS_ActivationInterval=120 set KMS_RenewalInterval=10080 set KMS_HWID=0x3A1C049600B60076 -set Windows=Random -set Office2010=Random -set Office2013=Random -set Office2016=Random -set Office2019=Random set "SysPath=%Windir%\System32" if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative") @@ -22,11 +16,12 @@ fsutil dirty query %systemdrive% >nul 2>&1 || goto :E_Admin title SppExtComObjPatcher set "_workdir=%~dp0" +if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%" set xOS=x64 -if /i %PROCESSOR_ARCHITECTURE%==x86 (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32) +if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32) setlocal EnableExtensions EnableDelayedExpansion set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" -set "OSPP=HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" +set "OSPP=SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%') get Name 2>nul | findstr /i Windows 1>nul && (set SppHook=1) || (set SppHook=0) wmic path OfficeSoftwareProtectionService get Version >nul 2>&1 && (set OsppHook=1) || (set OsppHook=0) @@ -47,19 +42,23 @@ echo Microsoft (R) Windows Software Licensing. echo Copyright (C) Microsoft Corporation. All rights reserved. echo ========================================================= echo. -IF EXIST "%SystemRoot%\system32\SppExtComObj*.dll" goto :uninst +if exist "%SystemRoot%\system32\SppExtComObj*.dll" ( +dir /b /al "%SystemRoot%\system32\SppExtComObjHook.dll" >nul 2>&1 || goto :uninst +) :inst choice /C YN /N /M "SppExtComObjPatcher will be installed on your computer. Continue? [y/n]: " -IF ERRORLEVEL 2 exit +if errorlevel 2 exit call :StopService sppsvc if %OsppHook% NEQ 0 call :StopService osppsvc if %winbuild% GEQ 9600 ( -WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Add ExclusionPath="%SystemRoot%\system32\SppExtComObjHook.dll" >nul 2>&1 + WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Add ExclusionPath="%SystemRoot%\system32\SppExtComObjHook.dll" >nul 2>&1 ) echo. echo Copying Files... -if exist "%SystemRoot%\system32\SppExtComObjPatcher.*" del /f /q "%SystemRoot%\system32\SppExtComObjPatcher.*" %_Nul_1_2% +for %%# in (SppExtComObjHookAvrf.dll,SppExtComObjHook.dll,SppExtComObjPatcher.dll,SppExtComObjPatcher.exe) do ( + if exist "%SystemRoot%\system32\%%#" del /f /q "%SystemRoot%\system32\%%#" >nul 2>&1 +) copy /y "!_workdir!\!xOS!\SppExtComObjHook.dll" "%SystemRoot%\system32" >nul 2>&1 && (echo Copied SppExtComObjHook.dll) || (echo SppExtComObjHook.dll Failed&pause&exit /b) echo. echo Creating Registry Entries... @@ -74,28 +73,19 @@ if %OSType% EQU Win7 if %SppHook% NEQ 0 ( echo osppsvc.exe of Office %OffVer% call :CreateIFEOEntry osppsvc.exe if %winbuild% GEQ 9200 ( -schtasks /query /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" >nul 2>&1 || schtasks /create /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" /xml "!_workdir!\Win32\SvcTrigger.xml" /f >nul 2>&1 + schtasks /query /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" >nul 2>&1 || schtasks /create /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" /xml "!_workdir!\Win32\SvcTrigger.xml" /f >nul 2>&1 ) goto :End :uninst choice /C YN /N /M "SppExtComObjPatcher will be removed from your computer. Continue? [y/n]: " -IF ERRORLEVEL 2 exit +if errorlevel 2 exit call :StopService sppsvc if %OsppHook% NEQ 0 call :StopService osppsvc echo. echo Removing Installed Files... -if exist "%SystemRoot%\system32\SppExtComObjHook.dll" ( - echo SppExtComObjHook.dll - del /f /q "%SystemRoot%\system32\SppExtComObjHook.dll" -) -if exist "%SystemRoot%\system32\SppExtComObjPatcher.dll" ( - echo SppExtComObjPatcher.dll - del /f /q "%SystemRoot%\system32\SppExtComObjPatcher.dll" -) -if exist "%SystemRoot%\system32\SppExtComObjPatcher.exe" ( - echo SppExtComObjPatcher.exe - del /f /q "%SystemRoot%\system32\SppExtComObjPatcher.exe" +for %%# in (SppExtComObjHookAvrf.dll,SppExtComObjHook.dll,SppExtComObjPatcher.dll,SppExtComObjPatcher.exe) do ( + if exist "%SystemRoot%\system32\%%#" (echo %%#&del /f /q "%SystemRoot%\system32\%%#") ) echo. echo Removing Registry Entries... @@ -112,81 +102,86 @@ if %OSType% EQU Win7 if %SppHook% NEQ 0 ( if %ClearKMSCache% EQU 1 ( echo. echo Clearing KMS Cache... -call :cKMS SoftwareLicensingProduct SoftwareLicensingService -if %OsppHook% NEQ 0 call :cKMS OfficeSoftwareProtectionProduct OfficeSoftwareProtectionService +call :cKMS SoftwareLicensingProduct SoftwareLicensingService >nul 2>&1 +if %OsppHook% NEQ 0 call :cKMS OfficeSoftwareProtectionProduct OfficeSoftwareProtectionService >nul 2>&1 +call :cREG >nul 2>&1 ) if %winbuild% GEQ 9200 ( schtasks /query /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" >nul 2>&1 && schtasks /delete /f /tn "\Microsoft\Windows\SoftwareProtectionPlatform\SvcTrigger" >nul 2>&1 ) if %winbuild% GEQ 9600 ( reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v "NoGenTicket" /f >nul 2>&1 -WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Remove ExclusionPath="%SystemRoot%\system32\SppExtComObjHook.dll" >nul 2>&1 -WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Remove ExclusionPath="%SystemRoot%\system32\SppExtComObjPatcher.dll" >nul 2>&1 -WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Remove ExclusionPath="%SystemRoot%\system32\SppExtComObjPatcher.exe" >nul 2>&1 +for %%# in (SppExtComObjHookAvrf.dll,SppExtComObjHook.dll,SppExtComObjPatcher.dll,SppExtComObjPatcher.exe) do ( + WMIC /NAMESPACE:\\root\Microsoft\Windows\Defender PATH MSFT_MpPreference call Remove ExclusionPath="%SystemRoot%\system32\%%#" >nul 2>&1 + ) ) goto :End :StopService sc query %1 | find /i "STOPPED" >nul || net stop %1 /y >nul 2>&1 sc query %1 | find /i "STOPPED" >nul || sc stop %1 >nul 2>&1 -goto :EOF +goto :eof :CreateIFEOEntry -reg add "%IFEO%\%1" /f /v Debugger /t REG_SZ /d "rundll32.exe SppExtComObjHook.dll,PatcherMain" >nul 2>&1 +reg delete "%IFEO%\%1" /f /v Debugger >nul 2>&1 +reg add "%IFEO%\%1" /f /v VerifierDlls /t REG_SZ /d "SppExtComObjHook.dll" >nul 2>&1 +reg add "%IFEO%\%1" /f /v GlobalFlag /t REG_DWORD /d 256 >nul 2>&1 reg add "%IFEO%\%1" /f /v KMS_Emulation /t REG_DWORD /d %KMS_Emulation% >nul 2>&1 reg add "%IFEO%\%1" /f /v KMS_ActivationInterval /t REG_DWORD /d %KMS_ActivationInterval% >nul 2>&1 reg add "%IFEO%\%1" /f /v KMS_RenewalInterval /t REG_DWORD /d %KMS_RenewalInterval% >nul 2>&1 -if /i %1 NEQ osppsvc.exe ( -reg add "%IFEO%\%1" /f /v Windows /t REG_SZ /d "%Windows%" >nul 2>&1 -if %winbuild% GEQ 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" >nul 2>&1 -) -if /i %1 EQU osppsvc.exe ( -reg add "%IFEO%\%1" /f /v Office2010 /t REG_SZ /d "%Office2010%" >nul 2>&1 -if %winbuild% LSS 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" >nul 2>&1 -reg add "%OSPP%" /f /v KeyManagementServiceName /t REG_SZ /d %KMS_IP% >nul 2>&1 -reg add "%OSPP%" /f /v KeyManagementServicePort /t REG_SZ /d %KMS_Port% >nul 2>&1 -) if /i %1 EQU SppExtComObj.exe if %winbuild% GEQ 9600 ( reg add "%IFEO%\%1" /f /v KMS_HWID /t REG_QWORD /d "%KMS_HWID%" >nul 2>&1 ) -goto :EOF +if /i %1 EQU osppsvc.exe ( +reg add "HKLM\%OSPP%" /f /v KeyManagementServiceName /t REG_SZ /d %KMS_IP% >nul 2>&1 +reg add "HKLM\%OSPP%" /f /v KeyManagementServicePort /t REG_SZ /d %KMS_Port% >nul 2>&1 +) +goto :eof :RemoveIFEOEntry if /i %1 NEQ osppsvc.exe ( reg delete "%IFEO%\%1" /f >nul 2>&1 -goto :EOF +goto :eof ) -for %%A in (Debugger,KMS_Emulation,KMS_ActivationInterval,KMS_RenewalInterval,Office2010,Office2013,Office2016,Office2019) do reg delete "%IFEO%\%1" /f /v %%A >nul 2>&1 -if %ClearKMSCache% EQU 1 ( -reg delete "%OSPP%" /f /v KeyManagementServiceName >nul 2>&1 -reg delete "%OSPP%" /f /v KeyManagementServicePort >nul 2>&1 +if %OsppHook% EQU 0 if /i %1 EQU osppsvc.exe ( +reg delete "%IFEO%\%1" /f >nul 2>&1 +goto :eof ) -goto :EOF +for %%A in (VerifierDlls,GlobalFlag,Debugger,KMS_Emulation,KMS_ActivationInterval,KMS_RenewalInterval,Office2010,Office2013,Office2016,Office2019) do reg delete "%IFEO%\%1" /f /v %%A >nul 2>&1 +goto :eof :cKMS set spp=%1 set sps=%2 -for /f "tokens=2 delims==" %%G in ('"wmic path %spp% where (Description like '%%KMSCLIENT%%') get ID /VALUE" 2^>nul') do (set app=%%G&call :Clear) +for /f "tokens=2 delims==" %%G in ('"wmic path %spp% where (Description like '%%KMSCLIENT%%') get ID /VALUE" 2^>nul') do (set app=%%G&call :cAPP) for /f "tokens=2 delims==" %%A in ('"wmic path %sps% get Version /VALUE"') do set ver=%%A -wmic path %sps% where version='%ver%' call ClearKeyManagementServiceMachine >nul 2>&1 -wmic path %sps% where version='%ver%' call ClearKeyManagementServicePort >nul 2>&1 -wmic path %sps% where version='%ver%' call DisableKeyManagementServiceDnsPublishing 1 >nul 2>&1 -wmic path %sps% where version='%ver%' call DisableKeyManagementServiceHostCaching 1 >nul 2>&1 -if /i %1 EQU SoftwareLicensingProduct ( -reg delete "HKLM\%SPPk%\55c92734-d682-4d71-983e-d6ec3f16059f" /f >nul 2>&1 -reg delete "HKLM\%SPPk%\0ff1ce15-a989-479d-af46-f275c6370663" /f >nul 2>&1 -reg delete "HKEY_USERS\S-1-5-20\%SPPk%\55c92734-d682-4d71-983e-d6ec3f16059f" /f >nul 2>&1 -reg delete "HKEY_USERS\S-1-5-20\%SPPk%\0ff1ce15-a989-479d-af46-f275c6370663" /f >nul 2>&1 -) else ( -reg delete "%OSPP%\59a52881-a989-479d-af46-f275c6370663" /f >nul 2>&1 -reg delete "%OSPP%\0ff1ce15-a989-479d-af46-f275c6370663" /f >nul 2>&1 -) -goto :EOF - -:Clear -wmic path %spp% where ID='%app%' call ClearKeyManagementServiceMachine >nul 2>&1 -wmic path %spp% where ID='%app%' call ClearKeyManagementServicePort >nul 2>&1 -goto :EOF +wmic path %sps% where version='%ver%' call ClearKeyManagementServiceMachine +wmic path %sps% where version='%ver%' call ClearKeyManagementServicePort +wmic path %sps% where version='%ver%' call DisableKeyManagementServiceDnsPublishing 1 +wmic path %sps% where version='%ver%' call DisableKeyManagementServiceHostCaching 1 +goto :eof + +:cAPP +wmic path %spp% where ID='%app%' call ClearKeyManagementServiceMachine +wmic path %spp% where ID='%app%' call ClearKeyManagementServicePort +goto :eof + +:cREG +reg delete "HKLM\%SPPk%\55c92734-d682-4d71-983e-d6ec3f16059f" /f +reg delete "HKLM\%SPPk%\0ff1ce15-a989-479d-af46-f275c6370663" /f +reg delete "HKLM\%SPPk%" /f /v KeyManagementServiceName +reg delete "HKLM\%SPPk%" /f /v KeyManagementServicePort +reg delete "HKU\S-1-5-20\%SPPk%\55c92734-d682-4d71-983e-d6ec3f16059f" /f +reg delete "HKU\S-1-5-20\%SPPk%\0ff1ce15-a989-479d-af46-f275c6370663" /f +reg delete "HKLM\%OSPP%\59a52881-a989-479d-af46-f275c6370663" /f +reg delete "HKLM\%OSPP%\0ff1ce15-a989-479d-af46-f275c6370663" /f +reg delete "HKLM\%OSPP%" /f /v KeyManagementServiceName +reg delete "HKLM\%OSPP%" /f /v KeyManagementServicePort +if %OsppHook% EQU 0 ( +reg delete "HKLM\%OSPP%" /f +reg delete "HKU\S-1-5-20\%OSPP%" /f +) +goto :eof :E_Admin echo ==== ERROR ==== @@ -195,7 +190,7 @@ echo To do so, right click on this script and select 'Run as administrator' echo. echo Press any key to exit... pause >nul -goto :EOF +goto :eof :UnsupportedVersion echo ==== ERROR ==== @@ -204,11 +199,11 @@ echo Project is supported only for Windows 7/8/8.1/10 and their Server equivalen echo. echo Press any key to exit... pause >nul -goto :EOF +goto :eof :End echo. echo Done. echo Press any key to exit... pause >nul -goto :EOF \ No newline at end of file +goto :eof \ No newline at end of file diff --git a/2-Activate-Local.cmd b/2-Activate-Local.cmd index 838949c..43557ae 100644 --- a/2-Activate-Local.cmd +++ b/2-Activate-Local.cmd @@ -1,46 +1,51 @@ @echo off -cls set _Debug=0 set Online=0 set KMS_IP=172.16.0.2 set KMS_Port=1688 +set KMS_ActivationInterval=120 +set KMS_RenewalInterval=10080 +set KMS_HWID=0x3A1C049600B60076 -:: detect and skip Windows 10 KMS 2038 -:: change to 0 to turn OFF and revert Windows 10 to normal KMS set KMS38=1 -set FixedEPID=1 - set "SysPath=%Windir%\System32" if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative") set "Path=%SysPath%;%Windir%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\" fsutil dirty query %systemdrive% >nul 2>&1 || goto :E_Admin -if %Online%==0 if not exist "%SystemRoot%\system32\SppExtComObj*.dll" goto :E_Patcher -if %Online%==0 set KMS_IP=172.16.0.2 + +if %Online%==0 ( +if not exist "%SystemRoot%\system32\SppExtComObj*.dll" goto :E_Patcher +if exist "%SystemRoot%\system32\SppExtComObj*.dll" dir /b /al "%SystemRoot%\system32\SppExtComObjHook.dll" >nul 2>&1 && goto :E_Patcher +set KMS_IP=172.16.0.2 +) set "_tempdir=%SystemRoot%\Temp" -set "_workdir=%~dp0" set "_logpath=%~dpn0" -dir /b /adr "%_workdir%" 1>nul 2>nul && set "_logpath=%_tempdir%\%~n0" -if "%_workdir:~0,2%"=="\\" set "_logpath=%_tempdir%\%~n0" +set "_workdir=%~dp0" +if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%" setlocal EnableExtensions EnableDelayedExpansion +set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" if %_Debug% EQU 0 ( set "_Nul_1=1>nul" set "_Nul_2=2>nul" set "_Nul_2e=2^>nul" set "_Nul_1_2=1>nul 2>nul" + set "_Pause=pause >nul" call :Begin ) else ( set "_Nul_1=" set "_Nul_2=" set "_Nul_2e=" set "_Nul_1_2=" + set "_Pause=" echo. echo Running in Debug Mode... echo The window will be closed when finished + copy /y nul "!_workdir!\#.rw" 1>nul 2>nul && (if exist "!_workdir!\#.rw" del /f /q "!_workdir!\#.rw") || (set "_logpath=!_tempdir!\%~n0") @echo on @prompt $G @call :Begin >"!_logpath!.tmp" 2>&1 &cmd /u /c type "!_logpath!.tmp">"!_logpath!_Debug.log"&del "!_logpath!.tmp" @@ -54,6 +59,7 @@ for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G if %winbuild% GEQ 9600 ( reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /f /v NoGenTicket /t REG_DWORD /d 1 %_Nul_1_2% ) +SET Win10Gov=0 if %winbuild% LSS 14393 goto :Main SET "RegKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" @@ -74,23 +80,29 @@ IF NOT DEFINED EditionWMI ( IF %winbuild% GEQ 17063 FOR /F "SKIP=2 TOKENS=3 DELIMS= " %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionId') DO SET "EditionID=%%A" GOTO :Main ) -FOR %%A IN (Cloud,CloudN) DO (IF /I "%EditionWMI%"=="%%A" GOTO :Main) +FOR %%A IN (Cloud,CloudN,IoTEnterprise,IoTEnterpriseS) DO (IF /I "%EditionWMI%"=="%%A" GOTO :Main) SET EditionID=%EditionWMI% +FOR %%A IN (EnterpriseG,EnterpriseGN) DO (IF /I "%EditionID%"=="%%A" SET Win10Gov=1) :Main reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration /v ProductReleaseIds %_Nul_1_2% && set "_C2R=HKLM\SOFTWARE\Microsoft\Office\ClickToRun\Configuration" if not defined _C2R reg query HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\ClickToRun\Configuration /v ProductReleaseIds %_Nul_1_2% && set "_C2R=HKLM\SOFTWARE\WOW6432Node\Microsoft\Office\ClickToRun\Configuration" for %%A in (14,15,16,19) do call :officeLoc %%A +if %Online%==0 ( +if %winbuild% GEQ 9200 call :UpdateIFEOEntry SppExtComObj.exe +if %winbuild% LSS 9200 call :UpdateIFEOEntry sppsvc.exe +call :UpdateIFEOEntry osppsvc.exe +) call :SPP call :OSPP -if %Online%==0 if %FixedEPID%==1 call :ePID if exist "!_tempdir!\*chk.txt" del /f /q "!_tempdir!\*chk.txt" +if exist "!_tempdir!\slmgr.vbs" del /f /q "!_tempdir!\slmgr.vbs" net stop sppsvc /y %_Nul_1_2% || sc stop sppsvc %_Nul_1_2% sc start sppsvc trigger=timer;sessionid=0 %_Nul_1_2% echo. echo. echo Press any key to exit... -if %_Debug% EQU 0 pause >nul +%_Pause% exit /b :SPP @@ -98,7 +110,8 @@ set spp=SoftwareLicensingProduct set sps=SoftwareLicensingService set W1nd0ws=1 wmic path %spp% where (Description like '%%KMSCLIENT%%') get Name %_Nul_2% | findstr /i Office %_Nul_1% && (set 0ff1ce15=1) -if %loc_off15% equ 0 if %loc_off16% equ 0 if %loc_off19% equ 0 (set "0ff1ce15="&set "aword=No Installed") else (set "aword=No Supported KMS Client") +set "aword=No Supported KMS Client" +if %loc_off15% equ 0 if %loc_off16% equ 0 if %loc_off19% equ 0 (set "0ff1ce15="&set "aword=No Installed") if not defined 0ff1ce15 if %winbuild% GEQ 9200 (echo.&echo %aword% Office 2013/2016/2019 Product Detected...) wmic path %spp% where (Description like '%%KMSCLIENT%%') get Name %_Nul_2% | findstr /i Windows %_Nul_1% && (set WinVL=1) || (echo.&echo No Supported KMS Client Windows Detected...) if not defined 0ff1ce15 if not defined WinVL exit /b @@ -169,11 +182,25 @@ call :winchk exit /b :winchk -echo. +if not defined tok (if %winbuild% GEQ 9200 (set "tok=4") else (set "tok=7")) +if not defined wApp set wApp=55c92734-d682-4d71-983e-d6ec3f16059f wmic path %spp% where (LicenseStatus='1' and Description like '%%KMSCLIENT%%') get Name %_Nul_2% | findstr /i "Windows" %_Nul_1_2% && (exit /b) +echo. wmic path %spp% where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name %_Nul_2% | findstr /i "Windows" %_Nul_1_2% && ( set WinPerm=1 -for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where ID='%app%' get Name /VALUE"') do echo Checking: %%x +) +if not defined WinPerm ( +wmic path %spp% where "ApplicationID='%wApp%' and LicenseStatus='1'" get Name %_Nul_2% | findstr /i "Windows" %_Nul_1_2% && ( +for /f "tokens=%tok% delims=, " %%G in ('"wmic path %spp% where (ApplicationID='%wApp%' and LicenseStatus='1') get Description /VALUE"') do set "channel=%%G" + for %%A in (VOLUME_MAK, RETAIL, OEM_DM, OEM_SLP, OEM_COA, OEM_COA_SLP, OEM_COA_NSLP, OEM_NONSLP, OEM) do if /i "%%A"=="!channel!" set WinPerm=1 + ) +) +if not defined WinPerm ( +copy /y %Windir%\System32\slmgr.vbs "!_tempdir!\slmgr.vbs" %_Nul_1_2% +cscript //nologo "!_tempdir!\slmgr.vbs" /xpr %_Nul_2% | findstr /i "permanently" %_Nul_1_2% && set WinPerm=1 +) +if defined WinPerm ( +for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where (ApplicationID='%wApp%' and LicenseStatus='1') get Name /VALUE"') do echo Checking: %%x echo Product is Permanently Activated. exit /b ) @@ -433,7 +460,7 @@ if /i %sps% equ SoftwareLicensingService wmic path %sps% where version='%ver%' c for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where ID='%1' get GracePeriodRemaining /VALUE"') do (set gpr=%%x&set /a gpr2=%%x/1440) if %gpr% equ 43200 if %office% equ 0 if %winbuild% geq 9200 (echo Windows Core/ProfessionalWMC Activation Successful&echo Remaining Period: 30 days ^(%gpr% minutes^)&exit /b) if %gpr% equ 64800 (echo Windows Core/ProfessionalWMC Activation Successful&echo Remaining Period: 45 days ^(%gpr% minutes^)&exit /b) -if %gpr% gtr 259200 (echo Windows 10 EnterpriseG/EnterpriseGN Activation Successful&echo Remaining Period: %gpr2% days ^(%gpr% minutes^)&exit /b) +if %gpr% gtr 259200 if %Win10Gov% equ 1 (echo Windows 10 %EditionID% Activation Successful&echo Remaining Period: %gpr2% days ^(%gpr% minutes^)&exit /b) if %gpr% equ 259200 ( echo Product Activation Successful ) else ( @@ -443,48 +470,11 @@ echo Product Activation Failed: 0x!=ExitCode! echo Remaining Period: %gpr2% days ^(%gpr% minutes^) exit /b -:ePID -set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" -for %%A in (WINEPID,O14EPID,O15EPID,O16EPID,O19EPID,WINRAND,O14RAND,O15RAND,O16RAND,O19RAND) do set %%A=0 -if %winbuild% LSS 9200 ( -set "winkey=sppsvc.exe" -set "o15key=osppsvc.exe" -set "o14key=osppsvc.exe" -set "o15svc=OfficeSoftwareProtectionProduct" -set "o14svc=OfficeSoftwareProtectionProduct" -) else ( -set "winkey=SppExtComObj.exe" -set "o15key=SppExtComObj.exe" -set "o14key=osppsvc.exe" -set "o15svc=SoftwareLicensingProduct" -set "o14svc=OfficeSoftwareProtectionProduct" -) -reg query "%IFEO%\%winkey%" /v Windows %_Nul_2% | findstr /i Random %_Nul_1% && set WINRAND=1 -reg query "%IFEO%\%o14key%" /v Office2010 %_Nul_2% | findstr /i Random %_Nul_1% && set O14RAND=1 -reg query "%IFEO%\%o15key%" /v Office2013 %_Nul_2% | findstr /i Random %_Nul_1% && set O15RAND=1 -reg query "%IFEO%\%o15key%" /v Office2016 %_Nul_2% | findstr /i Random %_Nul_1% && set O16RAND=1 -reg query "%IFEO%\%o15key%" /v Office2019 %_Nul_2% | findstr /i Random %_Nul_1% && set O19RAND=1 - -if defined WinVL if not defined WinPerm if %WINRAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path SoftwareLicensingProduct where (Description like '%%KMSCLIENT%%' AND Name like 'Windows%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" %_Nul_2e%') do set "WINEPID=%%A" -echo !WINEPID!| findstr /i "\-" %_Nul_1% && (reg add "%IFEO%\%winkey%" /f /v Windows /t REG_SZ /d "!WINEPID!" %_Nul_1_2%) -) -if %loc_off19% equ 1 if %O19RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Name like '%%KMS_Client_AE%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" %_Nul_2e%') do set "O19EPID=%%A" -echo !O19EPID!| findstr /i "\-" %_Nul_1% && (reg add "%IFEO%\%o15key%" /f /v Office2019 /t REG_SZ /d "!O19EPID!" %_Nul_1_2%) -) -if %loc_off16% equ 1 if %O16RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 16%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" %_Nul_2e%') do set "O16EPID=%%A" -echo !O16EPID!| findstr /i "\-" %_Nul_1% && (reg add "%IFEO%\%o15key%" /f /v Office2016 /t REG_SZ /d "!O16EPID!" %_Nul_1_2%) -) -if %loc_off15% equ 1 if %O15RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o15svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 15%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" %_Nul_2e%') do set "O15EPID=%%A" -echo !O15EPID!| findstr /i "\-" %_Nul_1% && (reg add "%IFEO%\%o15key%" /f /v Office2013 /t REG_SZ /d "!O15EPID!" %_Nul_1_2%) -) -if %loc_off14% equ 1 if %O14RAND% equ 1 ( -for /f "tokens=2 delims==" %%A in ('"wmic path %o14svc% where (Description like '%%KMSCLIENT%%' AND Name like 'Office 14%%' AND PartialProductKey is not NULL) get KeyManagementServiceProductKeyID /VALUE" %_Nul_2e%') do set "O14EPID=%%A" -echo !O14EPID!| findstr /i "\-" %_Nul_1% && (reg add "%IFEO%\%o14key%" /f /v Office2010 /t REG_SZ /d "!O14EPID!" %_Nul_1_2%) -) +:UpdateIFEOEntry +reg query "%IFEO%\%1" /v KMS_Emulation %_Nul_1_2% || exit /b +reg add "%IFEO%\%1" /f /v KMS_ActivationInterval /t REG_DWORD /d %KMS_ActivationInterval% %_Nul_1_2% +reg add "%IFEO%\%1" /f /v KMS_RenewalInterval /t REG_DWORD /d %KMS_RenewalInterval% %_Nul_1_2% +if /i %1 EQU SppExtComObj.exe if %winbuild% GEQ 9600 reg add "%IFEO%\%1" /f /v KMS_HWID /t REG_QWORD /d "%KMS_HWID%" %_Nul_1_2% exit /b :E_Admin @@ -512,5 +502,5 @@ echo Unsupported OS version Detected. echo Project is supported only for Windows 7/8/8.1/10 and their Server equivalent. echo. echo Press any key to exit... -if %_Debug% EQU 0 pause >nul +%_Pause% goto :eof \ No newline at end of file diff --git a/Check-Activation-Status-Alternative.cmd b/Check-Activation-Status-Alternative.cmd index 69d61d9..da34b3c 100644 --- a/Check-Activation-Status-Alternative.cmd +++ b/Check-Activation-Status-Alternative.cmd @@ -6,11 +6,11 @@ set osps=OfficeSoftwareProtectionService set winApp=55c92734-d682-4d71-983e-d6ec3f16059f set o14App=59a52881-a989-479d-af46-f275c6370663 set o15App=0ff1ce15-a989-479d-af46-f275c6370663 -for %%a in (spp_get,ospp_get,W1nd0ws,sppw,0ff1ce15,sppo,osppsvc,ospp14,ospp15) do set "%%a=" -for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G +for %%# in (spp_get,ospp_get,W1nd0ws,sppw,0ff1ce15,sppo,osppsvc,ospp14,ospp15) do set "%%#=" +for /f "tokens=6 delims=[]. " %%# in ('ver') do set winbuild=%%# set "spp_get=Description, DiscoveredKeyManagementServiceMachineName, DiscoveredKeyManagementServiceMachinePort, EvaluationEndDate, GracePeriodRemaining, ID, KeyManagementServiceMachine, KeyManagementServicePort, KeyManagementServiceProductKeyID, LicenseStatus, LicenseStatusReason, Name, PartialProductKey, ProductKeyID, VLActivationInterval, VLRenewalInterval" +set "ospp_get=%spp_get%" if %winbuild% geq 9200 set "spp_get=%spp_get%, DiscoveredKeyManagementServiceMachineIpAddress, KeyManagementServiceLookupDomain, ProductKeyChannel, VLActivationTypeEnabled" -set "ospp_get=Description, DiscoveredKeyManagementServiceMachineName, DiscoveredKeyManagementServiceMachinePort, EvaluationEndDate, GracePeriodRemaining, ID, KeyManagementServiceMachine, KeyManagementServicePort, KeyManagementServiceProductKeyID, LicenseStatus, LicenseStatusReason, Name, PartialProductKey, ProductKeyID, VLActivationInterval, VLRenewalInterval" set "SysPath=%Windir%\System32" if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative") @@ -32,8 +32,8 @@ echo. echo Error: product key not found. goto :SPPo ) -for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='%winApp%' and PartialProductKey is not null) get ID /value"') do ( - set "chkID=%%a" +for /f "tokens=2 delims==" %%# in ('"wmic path %spp% where (ApplicationID='%winApp%' and PartialProductKey is not null) get ID /value"') do ( + set "chkID=%%#" call :Property "%spp%" "%sps%" "%spp_get%" call :Output echo ____________________________________________________________________________ @@ -49,8 +49,8 @@ goto :End echo ************************************************************ echo *** Office Status *** echo ************************************************************ -for /f "tokens=2 delims==" %%a in ('"wmic path %spp% where (ApplicationID='%o15App%' and PartialProductKey is not null) get ID /value"') do ( - set "chkID=%%a" +for /f "tokens=2 delims==" %%# in ('"wmic path %spp% where (ApplicationID='%o15App%' and PartialProductKey is not null) get ID /value"') do ( + set "chkID=%%#" call :Property "%spp%" "%sps%" "%spp_get%" call :Output echo ____________________________________________________________________________ @@ -66,15 +66,15 @@ echo ************************************************************ echo *** Office Status *** echo ************************************************************ ) -if defined ospp15 for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ApplicationID='%o15App%' and PartialProductKey is not null) get ID /value"') do ( - set "chkID=%%a" +if defined ospp15 for /f "tokens=2 delims==" %%# in ('"wmic path %ospp% where (ApplicationID='%o15App%' and PartialProductKey is not null) get ID /value"') do ( + set "chkID=%%#" call :Property "%ospp%" "%osps%" "%ospp_get%" call :Output echo ____________________________________________________________________________ echo. ) -if defined ospp14 for /f "tokens=2 delims==" %%a in ('"wmic path %ospp% where (ApplicationID='%o14App%' and PartialProductKey is not null) get ID /value"') do ( - set "chkID=%%a" +if defined ospp14 for /f "tokens=2 delims==" %%# in ('"wmic path %ospp% where (ApplicationID='%o14App%' and PartialProductKey is not null) get ID /value"') do ( + set "chkID=%%#" call :Property "%ospp%" "%osps%" "%ospp_get%" call :Output echo ____________________________________________________________________________ @@ -87,10 +87,10 @@ wmic path %1 where (ApplicationID='%2' and PartialProductKey is not null) get ID exit /b :Property -for %%a in (%~3) do set "%%a=" -if %~1 equ %ospp% for %%a in (DiscoveredKeyManagementServiceMachineIpAddress, KeyManagementServiceLookupDomain, ProductKeyChannel, VLActivationTypeEnabled) do set "%%a=" +for %%# in (%~3) do set "%%#=" +if %~1 equ %ospp% for %%# in (DiscoveredKeyManagementServiceMachineIpAddress, KeyManagementServiceLookupDomain, ProductKeyChannel, VLActivationTypeEnabled) do set "%%#=" set "KmsClient=" -for /f "tokens=* delims=" %%a in ('"wmic path %~1 where (ID='%chkID%') get %~3 /value" ^| findstr ^=') do set "%%a" +for /f "tokens=* delims=" %%# in ('"wmic path %~1 where (ID='%chkID%') get %~3 /value" ^| findstr ^=') do set "%%#" set /a gprDays=%GracePeriodRemaining%/1440 echo %Description%| findstr /i VOLUME_KMSCLIENT 1>nul && (set KmsClient=1) @@ -143,7 +143,7 @@ if %DiscoveredKeyManagementServiceMachinePort%==0 set DiscoveredKeyManagementSer set "KmsDns=KMS machine name from DNS: %DiscoveredKeyManagementServiceMachineName%:%DiscoveredKeyManagementServiceMachinePort%" if "%DiscoveredKeyManagementServiceMachineName%"=="" set "KmsDns=DNS auto-discovery: KMS name not available" -for /f "tokens=* delims=" %%a in ('"wmic path %~2 get ClientMachineID, KeyManagementServiceHostCaching /value" ^| findstr ^=') do set "%%a" +for /f "tokens=* delims=" %%# in ('"wmic path %~2 get ClientMachineID, KeyManagementServiceHostCaching /value" ^| findstr ^=') do set "%%#" if /i %KeyManagementServiceHostCaching%==True (set KeyManagementServiceHostCaching=Enabled) else (set KeyManagementServiceHostCaching=Disabled) if %winbuild% lss 9200 exit /b @@ -175,8 +175,8 @@ echo Partial Product Key: %PartialProductKey% echo License Status: %License% if defined LicenseMsg echo %LicenseMsg% if not %LicenseStatus%==0 if not %EvaluationEndDate:~0,8%==16010101 echo Evaluation End Date: %EvaluationEndDate:~0,4%-%EvaluationEndDate:~4,2%-%EvaluationEndDate:~6,2% %EvaluationEndDate:~8,2%:%EvaluationEndDate:~10,2% UTC -if defined VLActivationTypeEnabled echo Configured Activation Type: %VLActivationType% if not defined KmsClient exit /b +if defined VLActivationTypeEnabled echo Configured Activation Type: %VLActivationType% echo. if not %LicenseStatus%==1 ( echo Please activate the product in order to update KMS client information values. diff --git a/Check-Activation-Status.cmd b/Check-Activation-Status.cmd index b51f842..1ae9804 100644 --- a/Check-Activation-Status.cmd +++ b/Check-Activation-Status.cmd @@ -1,128 +1,130 @@ -@ECHO OFF +@echo off set "SysPath=%Windir%\System32" if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative") set "Path=%SysPath%;%Windir%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\" -set "_tempdir=%temp%" -setlocal EnableExtensions EnableDelayedExpansion -ECHO ************************************************************ -ECHO *** Windows Status *** -ECHO ************************************************************ -COPY /Y %Windir%\System32\slmgr.vbs "!_tempdir!\slmgr.vbs" >NUL 2>&1 -cscript //nologo "!_tempdir!\slmgr.vbs" /dli || (ECHO Error running vbs script&DEL /F /Q "!_tempdir!\slmgr.vbs"&GOTO :End) +set "_tempdir=%SystemRoot%\Temp" +set bit=64&set wow=1 +if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (if "%PROCESSOR_ARCHITEW6432%"=="" set bit=32&set wow=0) +set "line=************************************************************" +setlocal EnableDelayedExpansion +echo %line% +echo *** Windows Status *** +echo %line% +copy /y %Windir%\System32\slmgr.vbs "!_tempdir!\slmgr.vbs" >nul 2>&1 +cscript //nologo "!_tempdir!\slmgr.vbs" /dli || (echo Error executing slmgr.vbs&del /f /q "!_tempdir!\slmgr.vbs"&goto :End) cscript //nologo "!_tempdir!\slmgr.vbs" /xpr -DEL /F /Q "!_tempdir!\slmgr.vbs" >NUL 2>&1 -ECHO ____________________________________________________________________________ +del /f /q "!_tempdir!\slmgr.vbs" >nul 2>&1 +echo ____________________________________________________________________________ :office2016 -IF EXIST %Windir%\SysWOW64\cmd.exe (SET bit=64&SET wow=1) ELSE (SET bit=32&SET wow=0) -SET office= -FOR /F "tokens=2*" %%a IN ('"REG QUERY HKLM\SOFTWARE\Microsoft\Office\16.0\Common\InstallRoot /v Path" 2^>NUL') DO (SET "office=%%b") -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2016 %bit%-bit Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +set office= +for /f "tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\16.0\Common\InstallRoot /v Path" 2^>nul') do (set "office=%%b") +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2016 %bit%-bit Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) -IF %wow%==0 GOTO :office2013 -SET office= -FOR /F "tokens=2*" %%a IN ('"REG QUERY HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\Common\InstallRoot /v Path" 2^>NUL') DO (SET "office=%%b") -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2016 32-bit Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +if %wow%==0 goto :office2013 +set office= +for /f "tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\16.0\Common\InstallRoot /v Path" 2^>nul') do (set "office=%%b") +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2016 32-bit Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) :office2013 -SET office= -FOR /F "tokens=2*" %%a IN ('"REG QUERY HKLM\SOFTWARE\Microsoft\Office\15.0\Common\InstallRoot /v Path" 2^>NUL') DO (SET "office=%%b") -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2013 %bit%-bit Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +set office= +for /f "tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\15.0\Common\InstallRoot /v Path" 2^>nul') do (set "office=%%b") +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2013 %bit%-bit Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) -IF %wow%==0 GOTO :office2010 -SET office= -FOR /F "tokens=2*" %%a IN ('"REG QUERY HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Common\InstallRoot /v Path" 2^>NUL') DO (SET "office=%%b") -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2013 32-bit Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +if %wow%==0 goto :office2010 +set office= +for /f "tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Common\InstallRoot /v Path" 2^>nul') do (set "office=%%b") +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2013 32-bit Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) :office2010 -SET office= -FOR /F "tokens=2*" %%a IN ('"REG QUERY HKLM\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot /v Path" 2^>NUL') DO (SET "office=%%b") -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2010 %bit%-bit Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +set office= +for /f "tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\14.0\Common\InstallRoot /v Path" 2^>nul') do (set "office=%%b") +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2010 %bit%-bit Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) -IF %wow%==0 GOTO :office2016C2R -SET office= -FOR /F "tokens=2*" %%a IN ('"REG QUERY HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot /v Path" 2^>NUL') DO (SET "office=%%b") -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2010 32-bit Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +if %wow%==0 goto :office2016C2R +set office= +for /f "tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Common\InstallRoot /v Path" 2^>nul') do (set "office=%%b") +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2010 32-bit Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) :office2016C2R -REG QUERY HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath >NUL 2>&1 || GOTO :office2013C2R -SET office= -for /f "tokens=2*" %%a IN ('"REG QUERY HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath" 2^>NUL') do (set "office=%%b\Office16") -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2016/2019 C2R Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath >nul 2>&1 || goto :office2013C2R +set office= +for /f "tokens=2*" %%a in ('"reg query HKLM\SOFTWARE\Microsoft\Office\ClickToRun /v InstallPath" 2^>nul') do (set "office=%%b\Office16") +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2016/2019 C2R Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) :office2013C2R -REG QUERY HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun /v InstallPath >NUL 2>&1 || GOTO :office2010C2R -SET office= -IF EXIST "%ProgramFiles%\Microsoft Office\Office15\OSPP.VBS" ( +reg query HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun /v InstallPath >nul 2>&1 || goto :office2010C2R +set office= +if exist "%ProgramFiles%\Microsoft Office\Office15\OSPP.VBS" ( set "office=%ProgramFiles%\Microsoft Office\Office15" -) else IF EXIST "%ProgramFiles(x86)%\Microsoft Office\Office15\OSPP.VBS" ( +) else if exist "%ProgramFiles(x86)%\Microsoft Office\Office15\OSPP.VBS" ( set "office=%ProgramFiles(x86)%\Microsoft Office\Office15" ) -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2013 C2R Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2013 C2R Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) :office2010C2R -REG QUERY HKLM\SOFTWARE\Microsoft\Office\14.0\ClickToRun /v InstallPath >NUL 2>&1 || GOTO :End -SET office= -IF EXIST "%ProgramFiles%\Microsoft Office\Office14\OSPP.VBS" ( +reg query HKLM\SOFTWARE\Microsoft\Office\14.0\ClickToRun /v InstallPath >nul 2>&1 || goto :End +set office= +if exist "%ProgramFiles%\Microsoft Office\Office14\OSPP.VBS" ( set "office=%ProgramFiles%\Microsoft Office\Office14" -) else IF EXIST "%ProgramFiles(x86)%\Microsoft Office\Office14\OSPP.VBS" ( +) else if exist "%ProgramFiles(x86)%\Microsoft Office\Office14\OSPP.VBS" ( set "office=%ProgramFiles(x86)%\Microsoft Office\Office14" ) -IF EXIST "%office%\OSPP.VBS" ( -ECHO. -ECHO ************************************************************ -ECHO *** Office 2010 C2R Status *** -ECHO ************************************************************ -cscript //nologo "%office%\OSPP.VBS" /dstatus +if exist "!office!\OSPP.VBS" ( +echo. +echo %line% +echo *** Office 2010 C2R Status *** +echo %line% +cscript //nologo "!office!\OSPP.VBS" /dstatus ) :End -ECHO. -ECHO Press any key to exit... +echo. +echo Press any key to exit... PAUSE >NUL EXIT /B \ No newline at end of file diff --git a/KMS_VL_ALL.cmd b/KMS_VL_ALL.cmd index c9b5f7d..5b5773b 100644 --- a/KMS_VL_ALL.cmd +++ b/KMS_VL_ALL.cmd @@ -1,35 +1,29 @@ @echo off -cls set _Debug=0 -:: detect and skip Windows 10 KMS 2038 -:: change to 0 to turn OFF and revert Windows 10 to normal KMS -set KMS38=1 - set KMS_Emulation=1 set KMS_IP=172.16.0.2 set KMS_Port=1688 set KMS_ActivationInterval=43200 set KMS_RenewalInterval=43200 set KMS_HWID=0x3A1C049600B60076 -set Windows=Random -set Office2010=Random -set Office2013=Random -set Office2016=Random -set Office2019=Random + +set KMS38=1 set "SysPath=%Windir%\System32" if exist "%Windir%\Sysnative\reg.exe" (set "SysPath=%Windir%\Sysnative") set "Path=%SysPath%;%Windir%;%SysPath%\Wbem;%SysPath%\WindowsPowerShell\v1.0\" fsutil dirty query %systemdrive% >nul 2>&1 || goto :E_Admin -if %_Debug% EQU 0 if exist "%SystemRoot%\system32\SppExtComObj*.dll" goto :E_Patcher + +if %_Debug% EQU 0 if exist "%SystemRoot%\system32\SppExtComObj*.dll" ( +dir /b /al "%SystemRoot%\system32\SppExtComObjHook.dll" >nul 2>&1 || goto :E_Patcher +) set "_tempdir=%SystemRoot%\Temp" -set "_workdir=%~dp0" set "_logpath=%~dpn0" -dir /b /adr "%_workdir%" 1>nul 2>nul && set "_logpath=%_tempdir%\%~n0" -if "%_workdir:~0,2%"=="\\" set "_logpath=%_tempdir%\%~n0" +set "_workdir=%~dp0" +if "%_workdir:~-1%"=="\" set "_workdir=%_workdir:~0,-1%" setlocal EnableExtensions EnableDelayedExpansion if %_Debug% EQU 0 ( @@ -37,15 +31,18 @@ if %_Debug% EQU 0 ( set "_Nul_2=2>nul" set "_Nul_2e=2^>nul" set "_Nul_1_2=1>nul 2>nul" + set "_Pause=pause >nul" call :Begin ) else ( set "_Nul_1=" set "_Nul_2=" set "_Nul_2e=" set "_Nul_1_2=" + set "_Pause=" echo. echo Running in Debug Mode... echo The window will be closed when finished + copy /y nul "!_workdir!\#.rw" 1>nul 2>nul && (if exist "!_workdir!\#.rw" del /f /q "!_workdir!\#.rw") || (set "_logpath=!_tempdir!\%~n0") @echo on @prompt $G @call :Begin >"!_logpath!.tmp" 2>&1 &cmd /u /c type "!_logpath!.tmp">"!_logpath!_Debug.log"&del "!_logpath!.tmp" @@ -56,7 +53,7 @@ exit /b color 1F title KMS_VL_ALL Manual set xOS=x64 -if /i %PROCESSOR_ARCHITECTURE%==x86 (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32) +if /i "%PROCESSOR_ARCHITECTURE%"=="x86" (if "%PROCESSOR_ARCHITEW6432%"=="" set xOS=Win32) set "IFEO=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" set "OSPP=HKLM\SOFTWARE\Microsoft\OfficeSoftwareProtectionPlatform" set "SPPk=SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" @@ -74,6 +71,7 @@ if %winbuild% GEQ 9200 ( if %winbuild% GEQ 9600 ( reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %_Nul_1_2% ) +SET Win10Gov=0 if %winbuild% LSS 14393 goto :Main SET "RegKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages" @@ -96,13 +94,15 @@ GOTO :Main ) FOR %%A IN (Cloud,CloudN) DO (IF /I "%EditionWMI%"=="%%A" GOTO :Main) SET EditionID=%EditionWMI% +FOR %%A IN (EnterpriseG,EnterpriseGN) DO (IF /I "%EditionID%"=="%%A" SET Win10Gov=1) :Main call :StopService sppsvc if %OsppHook% NEQ 0 call :StopService osppsvc -if exist "%SystemRoot%\system32\SppExtComObjHook.dll" del /f /q "%SystemRoot%\system32\SppExtComObjHook.dll" %_Nul_1_2% -if exist "%SystemRoot%\system32\SppExtComObjPatcher.*" del /f /q "%SystemRoot%\system32\SppExtComObjPatcher.*" %_Nul_1_2% +for %%# in (SppExtComObjHookAvrf.dll,SppExtComObjHook.dll,SppExtComObjPatcher.dll,SppExtComObjPatcher.exe) do ( + if exist "%SystemRoot%\system32\%%#" del /f /q "%SystemRoot%\system32\%%#" %_Nul_1_2% +) set AclReset=0 mklink "%SystemRoot%\system32\SppExtComObjHook.dll" "!_workdir!\!xOS!\SppExtComObjHook.dll" %_Nul_1_2% icacls "%SystemRoot%\system32\SppExtComObjHook.dll" /findsid *S-1-5-32-545 %_Nul_2% | find /i "SppExtComObjHook.dll" %_Nul_1% || ( @@ -120,6 +120,7 @@ for %%A in (14,15,16,19) do call :officeLoc %%A call :SPP call :OSPP if exist "!_tempdir!\*chk.txt" del /f /q "!_tempdir!\*chk.txt" +if exist "!_tempdir!\slmgr.vbs" del /f /q "!_tempdir!\slmgr.vbs" call :StopService sppsvc if %OsppHook% NEQ 0 call :StopService osppsvc @@ -137,7 +138,7 @@ sc start sppsvc trigger=timer;sessionid=0 %_Nul_1_2% echo. echo. echo Press any key to exit... -if %_Debug% EQU 0 pause >nul +%_Pause% exit /b :StopService @@ -146,18 +147,12 @@ sc query %1 | find /i "STOPPED" %_Nul_1% || sc stop %1 %_Nul_1_2% goto :eof :CreateIFEOEntry -reg add "%IFEO%\%1" /f /v Debugger /t REG_SZ /d "rundll32.exe SppExtComObjHook.dll,PatcherMain" %_Nul_1_2% +reg delete "%IFEO%\%1" /f /v Debugger %_Nul_1_2% +reg add "%IFEO%\%1" /f /v VerifierDlls /t REG_SZ /d "SppExtComObjHook.dll" %_Nul_1_2% +reg add "%IFEO%\%1" /f /v GlobalFlag /t REG_DWORD /d 256 %_Nul_1_2% reg add "%IFEO%\%1" /f /v KMS_Emulation /t REG_DWORD /d %KMS_Emulation% %_Nul_1_2% reg add "%IFEO%\%1" /f /v KMS_ActivationInterval /t REG_DWORD /d %KMS_ActivationInterval% %_Nul_1_2% reg add "%IFEO%\%1" /f /v KMS_RenewalInterval /t REG_DWORD /d %KMS_RenewalInterval% %_Nul_1_2% -if /i %1 NEQ osppsvc.exe ( -reg add "%IFEO%\%1" /f /v Windows /t REG_SZ /d "%Windows%" %_Nul_1_2% -if %winbuild% GEQ 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" %_Nul_1_2% -) -if /i %1 EQU osppsvc.exe ( -reg add "%IFEO%\%1" /f /v Office2010 /t REG_SZ /d "%Office2010%" %_Nul_1_2% -if %winbuild% LSS 9200 for %%A in (2013,2016,2019) do reg add "%IFEO%\%1" /f /v Office%%A /t REG_SZ /d "!Office%%A!" %_Nul_1_2% -) if /i %1 EQU SppExtComObj.exe if %winbuild% GEQ 9600 ( reg add "%IFEO%\%1" /f /v KMS_HWID /t REG_QWORD /d "%KMS_HWID%" %_Nul_1_2% ) @@ -168,22 +163,27 @@ if /i %1 NEQ osppsvc.exe ( reg delete "%IFEO%\%1" /f %_Nul_1_2% goto :eof ) -for %%A in (Debugger,KMS_Emulation,KMS_ActivationInterval,KMS_RenewalInterval,Office2010,Office2013,Office2016,Office2019) do reg delete "%IFEO%\%1" /v %%A /f %_Nul_1_2% +if %OsppHook% EQU 0 if /i %1 EQU osppsvc.exe ( +reg delete "%IFEO%\%1" /f >nul 2>&1 +goto :EOF +) +for %%A in (VerifierDlls,GlobalFlag,Debugger,KMS_Emulation,KMS_ActivationInterval,KMS_RenewalInterval,Office2010,Office2013,Office2016,Office2019) do reg delete "%IFEO%\%1" /v %%A /f %_Nul_1_2% reg delete "%OSPP%" /v KeyManagementServiceName /f %_Nul_1_2% reg delete "%OSPP%" /v KeyManagementServicePort /f %_Nul_1_2% goto :eof :SPP -reg delete "HKLM\%SPPk%\55c92734-d682-4d71-983e-d6ec3f16059f" /f %_Nul_1_2% -reg delete "HKLM\%SPPk%\0ff1ce15-a989-479d-af46-f275c6370663" /f %_Nul_1_2% set spp=SoftwareLicensingProduct set sps=SoftwareLicensingService set W1nd0ws=1 wmic path %spp% where (Description like '%%KMSCLIENT%%') get Name %_Nul_2% | findstr /i Office %_Nul_1% && (set 0ff1ce15=1) -if %loc_off15% equ 0 if %loc_off16% equ 0 if %loc_off19% equ 0 (set "0ff1ce15="&set "aword=No Installed") else (set "aword=No Supported KMS Client") +set "aword=No Supported KMS Client" +if %loc_off15% equ 0 if %loc_off16% equ 0 if %loc_off19% equ 0 (set "0ff1ce15="&set "aword=No Installed") if not defined 0ff1ce15 if %winbuild% GEQ 9200 (echo.&echo %aword% Office 2013/2016/2019 Product Detected...) wmic path %spp% where (Description like '%%KMSCLIENT%%') get Name %_Nul_2% | findstr /i Windows %_Nul_1% && (set WinVL=1) || (echo.&echo No Supported KMS Client Windows Detected...) if not defined 0ff1ce15 if not defined WinVL exit /b +reg delete "HKLM\%SPPk%\55c92734-d682-4d71-983e-d6ec3f16059f" /f %_Nul_1_2% +reg delete "HKLM\%SPPk%\0ff1ce15-a989-479d-af46-f275c6370663" /f %_Nul_1_2% wmic path %spp% where (Description like '%%KMSCLIENT%%' and PartialProductKey is not NULL) get Name %_Nul_2% | findstr /i Windows %_Nul_1% && (set gvlk=1) || (set gvlk=0) set gpr=0 if %winbuild% geq 10240 if %KMS38% equ 1 if %gvlk% equ 1 for /f "tokens=2 delims==" %%A in ('"wmic path %spp% where (Description like '%%KMSCLIENT%%' and Name like 'Windows%%' and PartialProductKey is not NULL) get GracePeriodRemaining /VALUE" %_Nul_2e%') do set "gpr=%%A" @@ -250,11 +250,25 @@ call :winchk exit /b :winchk -echo. +if not defined tok (if %winbuild% GEQ 9200 (set "tok=4") else (set "tok=7")) +if not defined wApp set wApp=55c92734-d682-4d71-983e-d6ec3f16059f wmic path %spp% where (LicenseStatus='1' and Description like '%%KMSCLIENT%%') get Name %_Nul_2% | findstr /i "Windows" %_Nul_1_2% && (exit /b) +echo. wmic path %spp% where (LicenseStatus='1' and GracePeriodRemaining='0' and PartialProductKey is not NULL) get Name %_Nul_2% | findstr /i "Windows" %_Nul_1_2% && ( set WinPerm=1 -for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where ID='%app%' get Name /VALUE"') do echo Checking: %%x +) +if not defined WinPerm ( +wmic path %spp% where "ApplicationID='%wApp%' and LicenseStatus='1'" get Name %_Nul_2% | findstr /i "Windows" %_Nul_1_2% && ( +for /f "tokens=%tok% delims=, " %%G in ('"wmic path %spp% where (ApplicationID='%wApp%' and LicenseStatus='1') get Description /VALUE"') do set "channel=%%G" + for %%A in (VOLUME_MAK, RETAIL, OEM_DM, OEM_SLP, OEM_COA, OEM_COA_SLP, OEM_COA_NSLP, OEM_NONSLP, OEM) do if /i "%%A"=="!channel!" set WinPerm=1 + ) +) +if not defined WinPerm ( +copy /y %Windir%\System32\slmgr.vbs "!_tempdir!\slmgr.vbs" %_Nul_1_2% +cscript //nologo "!_tempdir!\slmgr.vbs" /xpr %_Nul_2% | findstr /i "permanently" %_Nul_1_2% && set WinPerm=1 +) +if defined WinPerm ( +for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where (ApplicationID='%wApp%' and LicenseStatus='1') get Name /VALUE"') do echo Checking: %%x echo Product is Permanently Activated. exit /b ) @@ -262,13 +276,13 @@ call :insKey %app% exit /b :OSPP -reg delete "%OSPP%\59a52881-a989-479d-af46-f275c6370663" /f %_Nul_1_2% -reg delete "%OSPP%\0ff1ce15-a989-479d-af46-f275c6370663" /f %_Nul_1_2% set spp=OfficeSoftwareProtectionProduct set sps=OfficeSoftwareProtectionService if %winbuild% LSS 9200 (set "aword=2010/2013/2016/2019") else (set "aword=2010") wmic path %sps% get Version /VALUE %_Nul_1_2% || (echo.&echo No Installed Office %aword% Product Detected...&exit /b) wmic path %spp% where (Description like '%%KMSCLIENT%%') get Name /VALUE %_Nul_1_2% || (echo.&echo No Supported KMS Client Office %aword% Product Detected...&exit /b) +reg delete "%OSPP%\59a52881-a989-479d-af46-f275c6370663" /f %_Nul_1_2% +reg delete "%OSPP%\0ff1ce15-a989-479d-af46-f275c6370663" /f %_Nul_1_2% for /f "tokens=2 delims==" %%A in ('"wmic path %sps% get Version /VALUE" %_Nul_2e%') do set ver=%%A wmic path %sps% where version='%ver%' call SetKeyManagementServiceMachine MachineName="%KMS_IP%" %_Nul_1_2% wmic path %sps% where version='%ver%' call SetKeyManagementServicePort %KMS_Port% %_Nul_1_2% @@ -531,7 +545,7 @@ if /i %sps% equ SoftwareLicensingService wmic path %sps% where version='%ver%' c for /f "tokens=2 delims==" %%x in ('"wmic path %spp% where ID='%1' get GracePeriodRemaining /VALUE"') do (set gpr=%%x&set /a gpr2=%%x/1440) if %gpr% equ 43200 if %office% equ 0 if %winbuild% geq 9200 (echo Windows Core/ProfessionalWMC Activation Successful&echo Remaining Period: 30 days ^(%gpr% minutes^)&exit /b) if %gpr% equ 64800 (echo Windows Core/ProfessionalWMC Activation Successful&echo Remaining Period: 45 days ^(%gpr% minutes^)&exit /b) -if %gpr% gtr 259200 (echo Windows 10 EnterpriseG/EnterpriseGN Activation Successful&echo Remaining Period: %gpr2% days ^(%gpr% minutes^)&exit /b) +if %gpr% gtr 259200 if %Win10Gov% equ 1 (echo Windows 10 %EditionID% Activation Successful&echo Remaining Period: %gpr2% days ^(%gpr% minutes^)&exit /b) if %gpr% equ 259200 ( echo Product Activation Successful ) else ( @@ -554,7 +568,7 @@ goto :eof echo ==== ERROR ==== echo SppExtComObjPatcher is installed on the system. echo use SppExtComObjPatcher.cmd to uninstall it first -echo before you can use this script for standalone activation. +echo before you can use this script for manual offline activation. echo. echo Press any key to exit... pause >nul @@ -566,5 +580,5 @@ echo Unsupported OS version Detected. echo Project is supported only for Windows 7/8/8.1/10 and their Server equivalent. echo. echo Press any key to exit... -if %_Debug% EQU 0 pause >nul +%_Pause% goto :eof \ No newline at end of file diff --git a/Win32/SppExtComObjHook.dll b/Win32/SppExtComObjHook.dll index b77adc3..bab793a 100644 Binary files a/Win32/SppExtComObjHook.dll and b/Win32/SppExtComObjHook.dll differ diff --git a/Win32/key.cmd b/Win32/key.cmd index 7ed6330..1182887 100644 --- a/Win32/key.cmd +++ b/Win32/key.cmd @@ -1,5 +1,5 @@ if "%~1"=="" exit /b -goto :%1 || exit /b +goto :%1 2>nul || exit /b :: Windows 10 [RS5] :32d2fab3-e4a8-42c2-923b-4bf4fd13e6ee diff --git a/x64/SppExtComObjHook.dll b/x64/SppExtComObjHook.dll index ac86d1a..6d22339 100644 Binary files a/x64/SppExtComObjHook.dll and b/x64/SppExtComObjHook.dll differ