From c9ae06cac97d188aed33b690dfa46fc802200538 Mon Sep 17 00:00:00 2001 From: abbodi1406 <33669284+abbodi1406@users.noreply.github.com> Date: Wed, 20 Nov 2019 03:17:40 +0300 Subject: [PATCH] v0.0.11-alpha Add: embedded ReadMe.html Update: menu look, external activation option --- KMS_VL_ALL_AIO.cmd | 598 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 585 insertions(+), 13 deletions(-) diff --git a/KMS_VL_ALL_AIO.cmd b/KMS_VL_ALL_AIO.cmd index 2ba4992..c0c21d3 100644 --- a/KMS_VL_ALL_AIO.cmd +++ b/KMS_VL_ALL_AIO.cmd @@ -257,32 +257,35 @@ set _el= echo. echo %line3% echo. -echo 1. Activate: [%_dMode%] Mode +echo [1] Activate: [%_dMode%] Mode echo. -echo 2. Install Auto Renewal [%_dHook%] -echo 3. Uninstall Completely +echo [2] Install Auto Renewal [%_dHook%] +echo [3] Uninstall Completely echo %line4% echo. echo Configuration: echo. -echo 4. Process Windows [%_dAwin%] -echo 5. Process Office [%_dAoff%] -if %winbuild% GEQ 10240 echo W. Skip Windows 10 KMS38 [%_dWXKMS%] +echo [4] Process Windows [%_dAwin%] +echo [5] Process Office [%_dAoff%] +if %winbuild% GEQ 10240 echo [W] Skip Windows 10 KMS38 [%_dWXKMS%] echo %line4% echo. echo Miscellaneous: echo. -echo 6. Check Activation Status [vbs] -echo 7. Check Activation Status [wmic] -if defined _ckc echo 8. Clear KMS Cache +echo [6] Check Activation Status [vbs] +echo [7] Check Activation Status [wmic] +if defined _ckc echo [8] Clear KMS Cache +echo [R] Read Me +echo [S] Create $OEM$ Folder echo %line4% echo. -echo 9. Activate: [External] Mode +echo [9] Activate: [External] Mode echo %line3% echo. -choice /c 1234567890W /n /m "> Choose a menu option, or press 0 to Exit: " +choice /c 1234567890RW /n /m "> Choose a menu option, or press 0 to Exit: " set _el=%errorlevel% -if %_el%==11 if %winbuild% GEQ 10240 (if %SkipKMS38% EQU 0 (set SkipKMS38=1) else (set SkipKMS38=0))&goto :MainMenu +if %_el%==12 if %winbuild% GEQ 10240 (if %SkipKMS38% EQU 0 (set SkipKMS38=1) else (set SkipKMS38=0))&goto :MainMenu +if %_el%==11 (call :CreateReadMe)&goto :MainMenu if %_el%==10 goto :eof if %_el%==9 goto :E_IP if %_el%==8 if defined _ckc (set _verb=0&cls&goto :cCache) @@ -1029,7 +1032,7 @@ schtasks /query /tn "%_TaskEx%" %_Nul3% || ( ) schtasks /query /tn "%_TaskEx%" %_Nul3% || ( pushd %_temp% -%_Nul3% powershell -noprofile -exec bypass -c "$f=[io.file]::ReadAllText('%~f0') -split ':spptask\:.*';iex ($f[1]);" & exit/b +%_Nul3% powershell -noprofile -exec bypass -c "$f=[io.file]::ReadAllText('%~f0') -split ':spptask\:.*';iex ($f[1]);" popd if exist "!_temp!\SvcTrigger.xml" ( schtasks /create /tn "%_TaskEx%" /xml "!_temp!\SvcTrigger.xml" /f %_Nul3% @@ -1043,6 +1046,14 @@ echo "%_TaskEx%" ) goto :eof +:CreateReadMe +if exist "%temp%\ReadMe.html" del /f /q "%temp%\ReadMe.html" +pushd %temp% +%_Nul3% powershell -noprofile -exec bypass -c "$f=[io.file]::ReadAllText('%~f0') -split ':readme\:.*';iex ($f[1]);" +popd +if exist "%temp%\ReadMe.html" start "" "%temp%\ReadMe.html" +goto :eof + :casVm cls %_Nul3% powershell -noprofile -exec bypass -c "&{$H=get-host;$W=$H.ui.rawui;$B=$W.buffersize;$B.height=300;$W.buffersize=$B;}" @@ -2324,6 +2335,566 @@ Add-Type -Language CSharp -TypeDefinition @" :spptask: +:readme: +[io.file]::WriteAllText("ReadMe.html",$f[2].Trim(),[System.Text.Encoding]::UTF8); + +:readme: + + + + + KMS_VL_ALL + + + +
+
+ +

KMS_VL_ALL - Smart Activation Script

+ + + + + +
+
+ +

How it works?

+ + + + + + + + +
+
+ +

Supported Products

+

Volume-capable:

+ +

Unsupported Products:

+ +

These editions are only KMS-activatable for 45 days at max:

+ +

These editions are only KMS-activatable for 30 days at max:

+ +

Notes:

+ +
+
+ +

Office Retail to Volume

+

Office Retail must be converted to Volume first, before it can be activated with KMS
+ this includes Office C2R 365/2019/2016/2013 installed from default image files (e.g. ProPlus2019Retail.img)

+

To do so, you need to use this licensing converter script:
+ C2R-Retail2Volume

+

You can use other tools that can convert licensing:

+ +

Note: only OfficeRTool support converting Office UWP (modern Windows 10 Apps).

+
+
+ +

How To Use

+ + + + + +
+
+ +

Activation Modes

+
+

Auto Renewal

+

Recommended mode, where you need to run Activate.cmd once, afterwards, the system itself handle and renew activation per schedule.

+

To get this mode:

+ +

If you use Antivirus software, it is best to exclude this file from scanning protection:
C:\Windows\System32\SppExtComObjHook.dll

+

If Windows Defender is enabled on Windows 8.1 or 10, AutoRenewal-Setup.cmd adds the required exclusion upon installation.

+

Additionally, on Windows 8 and later, AutoRenewal-Setup.cmd duplicate inbox system schedule task SvcRestartTaskLogon to SvcTrigger
+ 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.

+

If you later installed Volume Office product(s), it will be auto activated in this mode.

+

You can remove the extracted folder contents, it is not needed after installation.

+

Run AutoRenewal-Setup.cmd again if you want to remove and uninstall the auto renewal solution.

+
+
+ +

Manual

+

Easy mode, where you only need to run Activate.cmd, without leaving any KMS emulator traces in the system.

+

To get this mode:

+ +

You will have to run Activate.cmd again before the KMS activation period expire.

+

You can run Activate.cmd anytime during that period to renew the period to the max interval.

+

If Activate.cmd is accidentally terminated before it completes, 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.

+

External server can be a web address, or a network IP address (e.g. for local LAN or VM).

+

To get this mode:

+ +

If you later installed Volume Office product(s), it will be auto activated if the external server is still available

+

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,
+ otherwise, you need another manual run against new available server.

+

If you want to clean the server registration, run Activate.cmd in Manual mode once.
+ or else, use this external script: Clear-KMS-Cache

+
+
+ +

Additional Options

+
+ +

Unattended Switches

+

+ Activate.cmd command line switches (case-insensitive) +

+ + + + + + + + + +

+ AutoRenewal-Setup.cmd command line switches (case-insensitive) +

+ + + + + + + + +

+ Notes: +

+ +

+ Examples: +

+
+
+Activate.cmd /s /e /w 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
+
+    
+

===========

+
+ +

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:

+ +

To do that:

+ +

Notice:
+ the turn OFF choice 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, specially on Windows 8 and later.

+

===========

+
+ +

Skip Windows 10 KMS 2038

+

+ Activate.cmd is set by default to check and skip Windows 10 activation if KMS 2038 is detected

+

However, if you want to to revert to normal KMS activation:

+ +

Notice:
+ if SkipKMS38 is ON, Windows will always get checked and processed, even if ActWindows is OFF.

+

===========

+
+ +

Advanced KMS Options

+

You can modify KMS-related options by editing Activate.cmd prior running.

+ + + + +
+
+ +

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-cick to run is enough.

+

+ Check-Activation-Status.cmd:

+ +

+ Check-Activation-Status-Alternative.cmd:

+ +
+
+ +

Setup Preactivate

+

To preactivate the system during installation, copy $oem$ folder to sources folder in the 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

+

Use AutoRenewal-Setup.cmd if you want to uninstall the project afterwards.

+

Notes:

+ +
+
+ +

Troubleshooting

+

If the activation failed at first run:

+ +

For Windows 7, if 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 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 - 0xC004F034

+

If the activation still failed after the above tips, you may enable the debug mode to help determine the reason:

+ +

Final tip, you may try to rebuild licensing Tokens.dat as suggested in KB2736303 (this may require you to repair Office afterwards).

+
+
+ +

Source Code

+
+

SppExtComObjHookAvrf

+

+ https://forums.mydigitallife.net/posts/1508167/ +
+ https://0x0.st/zPKX.7z +

+

Visual 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 & 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://0x0.st/zHAP.7z +

+

MinGW GCC:

+

+ https://forums.mydigitallife.net/posts/1462101/ +
+ https://0x0.st/zHAK.7z +

+
+
+ +

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.
+ qewpal - KMS-VL-ALL script.
+ Windows_Addict - suggestions, ideas and documentation help.
+ NormieLyfe - GVLK categorize, Office checks help.
+ mxman2k, rpo, 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.
+ ZWT, nosferati87, crony12, FreeStyler, Phazor - KMS Emulator development.

+
+
+ + + + +:readme: + :E_Admin echo %_err% echo This script require administrator privileges. @@ -2358,6 +2929,7 @@ echo %_err% echo Unsupported OS version Detected. echo Project is supported only for Windows 7/8/8.1/10 and their Server equivalent. :TheEnd +if exist "%temp%\ReadMe.html" del /f /q "%temp%\ReadMe.html" echo. if %Unattend% EQU 0 echo Press any key to exit. %_Pause%