Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated
  • Loading branch information
JakeyPrime committed Nov 21, 2023
1 parent c3c6abc commit 8d11888
Show file tree
Hide file tree
Showing 14 changed files with 1,588 additions and 899 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@

MAS/.DS_Store

.DS_Store
948 changes: 541 additions & 407 deletions MAS/All-In-One-Version/MAS_AIO.cmd

Large diffs are not rendered by default.

351 changes: 224 additions & 127 deletions MAS/Separate-Files-Version/Activators/HWID_Activation.cmd

Large diffs are not rendered by default.

354 changes: 230 additions & 124 deletions MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd

Large diffs are not rendered by default.

This file was deleted.

Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd
@@ -1,4 +1,4 @@
@set masver=2.3
@set masver=2.5
@setlocal DisableDelayedExpansion
@echo off

Expand Down Expand Up @@ -138,14 +138,18 @@ if /i "%%A"=="-el" (set _elev=1

::========================================================================================================================================

set "nul1=1>nul"
set "nul2=2>nul"
set "nul6=2^>nul"
set "nul=>nul 2>&1"

set psc=powershell.exe
set winbuild=1
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G

set _NCS=1
if %winbuild% LSS 10586 set _NCS=0
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0)
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)

call :_colorprep
set "_buf={$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
Expand Down Expand Up @@ -188,7 +192,7 @@ setlocal EnableDelayedExpansion

::========================================================================================================================================

echo "!_batf!" | find /i "!_ttemp!" 1>nul && (
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
if /i not "!_work!"=="!_ttemp!" (
%nceline%
echo Script is launched from the temp folder,
Expand All @@ -203,10 +207,10 @@ goto Done

:: Elevate script as admin and pass arguments and preventing loop

>nul fltmc || (
%nul1% fltmc || (
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
%nceline%
echo This script require admin privileges.
echo This script requires admin privileges.
echo To do so, right click on this script and select 'Run as administrator'.
goto Done
)
Expand All @@ -219,8 +223,8 @@ goto Done
if defined _unattended set quedit=1
for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)

reg query HKCU\Console /v QuickEdit 2>nul | find /i "0x0" %nul% || if not defined quedit (
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul%
reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
start cmd.exe /c ""!_batf!" %_args% -qedit"
rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
exit /b
Expand All @@ -233,8 +237,8 @@ exit /b
set -=
set old=

for /f "delims=[] tokens=2" %%# in ('ping -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] echo "%%#" | find "127.69.%masver%" %nul1% || set old=1
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
)

if defined old (
Expand All @@ -244,7 +248,7 @@ echo You are running outdated version MAS %masver%
echo ________________________________________________
echo:
if not defined _unattended (
echo [1] Download Latest MAS
echo [1] Get Latest MAS
echo [0] Continue Anyway
echo:
call :_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
Expand Down
68 changes: 41 additions & 27 deletions MAS/Separate-Files-Version/Change_Edition.cmd
@@ -1,4 +1,4 @@
@set masver=2.3
@set masver=2.5
@setlocal DisableDelayedExpansion
@echo off

Expand Down Expand Up @@ -194,7 +194,7 @@ goto ced_done
%nul1% fltmc || (
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
%eline%
echo This script require admin privileges.
echo This script requires admin privileges.
echo To do so, right click on this script and select 'Run as administrator'.
goto ced_done
)
Expand All @@ -220,8 +220,8 @@ exit /b
set -=
set old=

for /f "delims=[] tokens=2" %%# in ('ping -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] echo "%%#" | find "127.69.%masver%" %nul1% || set old=1
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
)

if defined old (
Expand All @@ -230,7 +230,7 @@ echo ________________________________________________
echo You are running outdated version MAS %masver%
echo ________________________________________________
echo:
echo [1] Download Latest MAS
echo [1] Get Latest MAS
echo [0] Continue Anyway
echo:
call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :"
Expand Down Expand Up @@ -282,24 +282,7 @@ goto ced_done

::========================================================================================================================================

:: Check SKU value

set osSKU=
set slcSKU=
set wmiSKU=

if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
if "%slcSKU%"=="0" set slcSKU=
if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=

if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"

set osSKU=%slcSKU%
if not defined osSKU set osSKU=%wmiSKU%
call :dk_checksku

if not defined osSKU (
%eline%
Expand All @@ -324,7 +307,7 @@ if not defined osedition (
for /f "skip=2 tokens=3" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID %nul6%') do set "osedition=%%a"
)

:: Workaround for a Windows bug in builds between 1607 and 1709 where ProfessionalEducation is shown as Professional
:: Workaround for an issue in builds between 1607 and 1709 where ProfessionalEducation is shown as Professional

if %osSKU%==164 set osedition=ProfessionalEducation
if %osSKU%==165 set osedition=ProfessionalEducationN
Expand Down Expand Up @@ -354,7 +337,10 @@ for /f "skip=2 tokens=2*" %%a in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT

%psc% $ExecutionContext.SessionState.LanguageMode %nul2% | find /i "Full" %nul1% || (
%eline%
echo PowerShell is not responding properly. Aborting...
%psc% $ExecutionContext.SessionState.LanguageMode
echo:
echo PowerShell is not working. Aborting...
echo If you have applied restrictions on Powershell then undo those changes.
echo:
echo Check this page for help. %mas%troubleshoot
goto ced_done
Expand Down Expand Up @@ -654,6 +640,31 @@ exit /b

::========================================================================================================================================

:: Check SKU value

:dk_checksku

set osSKU=
set slcSKU=
set wmiSKU=
set regSKU=

if %winbuild% GEQ 14393 (set info=Kernel-BrandingInfo) else (set info=Kernel-ProductInfo)
set d1=%ref% [void]$TypeBuilder.DefinePInvokeMethod('SLGetWindowsInformationDWORD', 'slc.dll', 'Public, Static', 1, [int], @([String], [int].MakeByRefType()), 1, 3);
set d1=%d1% $Sku = 0; [void]$TypeBuilder.CreateType()::SLGetWindowsInformationDWORD('%info%', [ref]$Sku); $Sku
for /f "delims=" %%s in ('"%psc% %d1%"') do if not errorlevel 1 (set slcSKU=%%s)
if "%slcSKU%"=="0" set slcSKU=
if 1%slcSKU% NEQ +1%slcSKU% set slcSKU=

for /f "tokens=3 delims=." %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions" /v OSProductPfn %nul6%') do set "regSKU=%%a"
if %_wmic% EQU 1 for /f "tokens=2 delims==" %%a in ('"wmic Path Win32_OperatingSystem Get OperatingSystemSKU /format:LIST" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"
if %_wmic% EQU 0 for /f "tokens=1" %%a in ('%psc% "([WMI]'Win32_OperatingSystem=@').OperatingSystemSKU" %nul6%') do if not errorlevel 1 set "wmiSKU=%%a"

set osSKU=%slcSKU%
if not defined osSKU set osSKU=%wmiSKU%
if not defined osSKU set osSKU=%regSKU%
exit /b

:: Refresh license status

:dk_refresh
Expand All @@ -678,7 +689,11 @@ exit /b

if %_wmic% EQU 1 set "chkedi=for /f "tokens=2 delims==" %%a in ('"wmic path SoftwareLicensingProduct where (ApplicationID='55c92734-d682-4d71-983e-d6ec3f16059f') get LicenseFamily /VALUE" %nul6%')"
if %_wmic% EQU 0 set "chkedi=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISEARCHER]'SELECT LicenseFamily FROM SoftwareLicensingProduct WHERE ApplicationID=''55c92734-d682-4d71-983e-d6ec3f16059f''').Get()).LicenseFamily ^| %% {echo ('LicenseFamily='+$_)}" %nul6%')"
%chkedi% do (call set "_wtarget= !_wtarget! %%a ")
%chkedi% do (
call if exist %Systemdrive%\Windows\System32\spp\tokens\skus\%%a (
call set "_wtarget= !_wtarget! %%a "
)
)
exit /b

:: Check wmic.exe
Expand Down Expand Up @@ -729,7 +744,6 @@ function Test-PendingReboot
if (Test-Path -Path "$env:windir\WinSxS\pending.xml") { return $true }
if (Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -EA Ignore) { return $true }
if (Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -EA Ignore) { return $true }
if (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Name PendingFileRenameOperations -EA Ignore) { return $true }
try {
$util = [wmiclass]"\\.\root\ccm\clientsdk:CCM_ClientUtilities"
$status = $util.DetermineIfRebootPending()
Expand Down
2 changes: 1 addition & 1 deletion MAS/Separate-Files-Version/Check-Activation-Status-vbs.cmd
Expand Up @@ -4,7 +4,7 @@



:: Check-Activation-Status-vbs.cmd
:: Check-Activation-Status
:: Written by @abbodi1406
:: forums.mydigitallife.net/posts/838808

Expand Down
5 changes: 2 additions & 3 deletions MAS/Separate-Files-Version/Check-Activation-Status-wmi.cmd
@@ -1,10 +1,9 @@
<!-- : Begin batch script
@setlocal DisableDelayedExpansion
@echo off



:: Check-Activation-Status-wmi.cmd
:: Check-Activation-Status
:: Written by @abbodi1406
:: forums.mydigitallife.net/posts/838808

Expand Down Expand Up @@ -363,7 +362,7 @@ if defined DiscoveredKeyManagementServiceMachineIpAddress echo. KMS machine I
echo. KMS machine extended PID: %KeyManagementServiceProductKeyID%
echo. Activation interval: %VLActivationInterval% minutes
echo. Renewal interval: %VLRenewalInterval% minutes
echo. KMS host caching: %KeyManagementServiceHostCaching%
echo. K.M.S host caching: %KeyManagementServiceHostCaching%
if defined KeyManagementServiceLookupDomain echo. KMS SRV record lookup domain: %KeyManagementServiceLookupDomain%
if defined ExpireMsg echo.&echo. %ExpireMsg%
exit /b
Expand Down

0 comments on commit 8d11888

Please sign in to comment.