From 9936a1d3a17411ddcea972d3d416b009ab1c849a Mon Sep 17 00:00:00 2001 From: WindowsAddict Date: Mon, 16 Oct 2023 08:20:03 +0530 Subject: 2.3 --- .../Activators/HWID_Activation.cmd | 39 +++++++- .../Activators/KMS38_Activation.cmd | 44 +++++++-- .../Activators/Ohook_Activation/BIN/sppc32.dll | Bin 9216 -> 9216 bytes .../Activators/Ohook_Activation/BIN/sppc64.dll | Bin 9216 -> 9728 bytes .../Ohook_Activation/Ohook_Activation.cmd | 105 +++++++++++++-------- .../Activators/Online_KMS_Activation.cmd | 44 +++++++-- MAS/Separate-Files-Version/Change_Edition.cmd | 92 +++++++++++++++++- MAS/Separate-Files-Version/Extract_OEM_Folder.cmd | 60 ++++++++---- MAS/Separate-Files-Version/Troubleshoot.cmd | 66 ++++++++++--- 9 files changed, 358 insertions(+), 92 deletions(-) (limited to 'MAS/Separate-Files-Version') diff --git a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd index 117bc18..4335271 100644 --- a/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/HWID_Activation.cmd @@ -1,3 +1,4 @@ +@set masver=2.3 @setlocal DisableDelayedExpansion @echo off @@ -97,7 +98,7 @@ popd cls color 07 -title HWID Activation +title HWID Activation %masver% set _args= set _elev= @@ -194,7 +195,7 @@ set "_batp=%_batf:'=''%" set _PSarg="""%~f0""" -el %_args% -set "_ttemp=%temp%" +set "_ttemp=%userprofile%\AppData\Local\Temp" setlocal EnableDelayedExpansion @@ -240,9 +241,37 @@ exit /b ::======================================================================================================================================== +:: Check for updates + +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 +) + +if defined old ( +echo ________________________________________________ +%eline% +echo You are running outdated version MAS %masver% +echo ________________________________________________ +echo: +if not %_unattended%==1 ( +echo [1] Download Latest MAS +echo [0] Continue Anyway +echo: +call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :" +choice /C:10 /N +if !errorlevel!==2 rem +if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b) +) +) + +::======================================================================================================================================== + cls mode 108, 34 -title HWID Activation +title HWID Activation %masver% :: Start Windows update service at the beginning and in later checks as well, because in some normal conditions one kick is not enough @@ -891,7 +920,7 @@ set showfix=1 if defined safeboot_option ( set error=1 set showfix=1 -call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" +call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[Safe mode found. Run in normal mode.]" ) @@ -905,7 +934,7 @@ call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_ reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( set error=1 set showfix=1 -call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]" +call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE mode found. Run in normal mode.]" ) diff --git a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd index db57129..721d707 100644 --- a/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/KMS38_Activation.cmd @@ -1,3 +1,4 @@ +@set masver=2.3 @setlocal DisableDelayedExpansion @echo off @@ -100,7 +101,7 @@ popd cls color 07 -title KMS38 Activation +title KMS38 Activation %masver% set _args= set _elev= @@ -193,7 +194,7 @@ set "_batp=%_batf:'=''%" set _PSarg="""%~f0""" -el %_args% -set "_ttemp=%temp%" +set "_ttemp=%userprofile%\AppData\Local\Temp" setlocal EnableDelayedExpansion @@ -239,6 +240,35 @@ exit /b ::======================================================================================================================================== +:: Check for updates + +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 +) + +if defined old ( +echo ________________________________________________ +%eline% +echo You are running outdated version MAS %masver% +echo ________________________________________________ +echo: +if not %_unattended%==1 ( +echo [1] Download Latest MAS +echo [0] Continue Anyway +echo: +call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :" +choice /C:10 /N +if !errorlevel!==2 rem +if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b) +) +) +cls + +::======================================================================================================================================== + if %_rem%==1 goto :k_uninstall :k_menu @@ -246,7 +276,7 @@ if %_rem%==1 goto :k_uninstall if %_unattended%==0 ( cls mode 76, 25 -title KMS38 Activation +title KMS38 Activation %masver% echo: echo: @@ -277,7 +307,7 @@ goto :k_menu cls mode 108, 34 -title KMS38 Activation +title KMS38 Activation %masver% echo: echo Initializing... @@ -754,7 +784,7 @@ goto :dk_done cls mode 99, 28 -title Remove KMS38 Protection +title Remove KMS38 Protection %masver% %nul% reg delete "HKLM\%specific_kms%" /f %nul% reg delete "HKU\S-1-5-20\%specific_kms%" /f @@ -1037,7 +1067,7 @@ set showfix=1 if defined safeboot_option ( set error=1 set showfix=1 -call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" +call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[Safe mode found. Run in normal mode.]" ) @@ -1051,7 +1081,7 @@ call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_ reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( set error=1 set showfix=1 -call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]" +call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE mode found. Run in normal mode.]" ) diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dll b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dll index 42dc642..14fb3dc 100644 Binary files a/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dll and b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc32.dll differ diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dll b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dll index 03dfff6..b6d5dac 100644 Binary files a/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dll and b/MAS/Separate-Files-Version/Activators/Ohook_Activation/BIN/sppc64.dll differ diff --git a/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd b/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd index 70e54aa..7549b80 100644 --- a/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Ohook_Activation/Ohook_Activation.cmd @@ -1,3 +1,4 @@ +@set masver=2.3 @setlocal DisableDelayedExpansion @echo off @@ -97,7 +98,7 @@ popd cls color 07 -title Ohook Activation +title Ohook Activation %masver% set _args= set _elev= @@ -186,7 +187,7 @@ set "_batp=%_batf:'=''%" set _PSarg="""%~f0""" -el %_args% -set "_ttemp=%temp%" +set "_ttemp=%userprofile%\AppData\Local\Temp" setlocal EnableDelayedExpansion @@ -232,6 +233,35 @@ exit /b ::======================================================================================================================================== +:: Check for updates + +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 +) + +if defined old ( +echo ________________________________________________ +%eline% +echo You are running outdated version MAS %masver% +echo ________________________________________________ +echo: +if not %_unattended%==1 ( +echo [1] Download Latest MAS +echo [0] Continue Anyway +echo: +call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :" +choice /C:10 /N +if !errorlevel!==2 rem +if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b) +) +) +cls + +::======================================================================================================================================== + if %_rem%==1 goto :oh_uninstall :oh_menu @@ -239,7 +269,7 @@ if %_rem%==1 goto :oh_uninstall if %_unattended%==0 ( cls mode 76, 25 -title Ohook Activation +title Ohook Activation %masver% echo: echo: @@ -275,7 +305,7 @@ cls mode 128, 32 %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=32;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" -title Ohook Activation +title Ohook Activation %masver% :: Check files @@ -496,35 +526,28 @@ call :oh_hookinstall ::======================================================================================================================================== :: Find remnants of Office vNext license block and remove it because it stops non vNext licenses from appearing +:: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state set sub_next= -set kNext=HKCU\SOFTWARE\Microsoft\Office\16.0\Common\Licensing -reg query %kNext%\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && ( -reg query %kNext%\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && ( +for /f "tokens=* delims=" %%a in ('%psc% "$userSIDs = Get-WmiObject -Class Win32_UserAccount | ForEach-Object {write-host $_.SID}" %nul6%') do (if defined _sid (set "_sid=!_sid! HKU\%%a") else (set "_sid=HKU\%%a")) + +for %%# in (!_sid! HKCU) do if not defined sub_next ( +reg query %%#\Software\Microsoft\Office\16.0\Common\Licensing\LicensingNext /v MigrationToV5Done %nul2% | find /i "0x1" %nul% && ( +reg query %%#\Software\Microsoft\Office\16.0\Common\Licensing\LicensingNext %nul2% | findstr /i "volume retail" %nul2% | findstr /i "0x2 0x3" %nul% && ( set sub_next=1 -reg delete %kNext% /f %nul% ) ) - -if defined sub_next ( -reg query %kNext%\LicensingNext %nul% && ( -call :dk_color %Red% "Removing Office vNext Block [Failed]" -) || ( -echo Removing Office vNext Block [Successful] -) ) -::======================================================================================================================================== - -:: Subscription licenses attempt to validate the license and may show a banner "There was a problem checking this device's license status.", other products don't do that. -:: A simple registry entry can skip this check - -if defined _sublic ( -echo Adding a Reg To Skip License Check [Successful] -reg add HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /v "TimeOfLastHeartbeatFailure" /t REG_SZ /d "2033-08-18T22:18:45Z" /f %nul% +if defined sub_next for %%# in (!_sid! HKCU) do ( +reg delete %%#\Software\Microsoft\Office\16.0\Common\Licensing /f %nul% +reg delete %%#\Software\Microsoft\Office\16.0\Common\Identity /f %nul% +reg delete %%#\Software\Microsoft\Office\16.0\Registration /f %nul% ) +if defined sub_next echo Removing Office vNext Block [Successful] + ::======================================================================================================================================== :: mass grave[.]dev/office-license-is-not-genuine.html @@ -607,7 +630,7 @@ goto :dk_done cls mode 99, 28 -title Uninstall Ohook Activation +title Uninstall Ohook Activation %masver% set _present= set _unerror= @@ -644,15 +667,21 @@ if exist "%%~A\Microsoft %%~G\root\vfs\%%#\sppc*dll" (set _present=1& del /s /f ) ) -reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /s %nul2% | find /i "2033" %nul% && ( +reg query HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && ( echo: -echo Deleting - HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency +echo Deleting - Registry keys to skip license check reg delete HKCU\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f + +for /f "tokens=* delims=" %%a in ('%psc% "$userSIDs = Get-WmiObject -Class Win32_UserAccount | ForEach-Object {write-host $_.SID}" %nul6%') do (if defined _sid (set "_sid=!_sid! %%a") else (set "_sid=%%a")) +for %%# in (!_sid!) do (reg query HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency %nul% && ( +reg delete HKU\%%#\Software\Microsoft\Office\16.0\Common\Licensing\Resiliency /f +) +) ) reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" %nul% && ( echo: -echo Deleting - Registry key to prevent non-genuine banner +echo Deleting - Registry keys to prevent non-genuine banner reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\0ff1ce15-a989-479d-af46-f275c6370663" /f ) @@ -789,6 +818,9 @@ exit /b set ierror= set hasherror= +if %_hook%==sppc32.dll set offset=2564 +if %_hook%==sppc64.dll set offset=3588 + del /s /q "%_hookPath%\sppcs.dll" %nul% del /s /q "%_hookPath%\sppc.dll" %nul% @@ -812,10 +844,12 @@ set error=1 call :dk_color %Red% "Symlinking Systems sppc.dll [Failed]" call :dk_color %Red% "Copying Custom %_hook% [Failed]" echo ["%_hookPath%\sppc.dll"] -call :dk_color %Blue% "Close Office apps if they are running and try again." +echo: +call :dk_color %Blue% "Close ALL Office apps including Outlook and try again." +call :dk_color %Blue% "If its still not resolved then restart system and try again." ) -if not defined ierror call :oh_modify "%_hookPath%\sppc.dll" +if not defined ierror call :oh_modify "%_hookPath%\sppc.dll" "%offset%" if not defined ierror ( if defined hasherror ( @@ -1076,7 +1110,7 @@ set showfix=1 if defined safeboot_option ( set error=1 set showfix=1 -call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[System is running in safe mode. Run in normal mode.]" +call :dk_color2 %Red% "Checking Boot Mode " %Blue% "[Safe mode found. Run in normal mode.]" ) @@ -1090,7 +1124,7 @@ call :dk_color2 %Red% "Checking Audit Mode " %Blue% "[IMAGE_ reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinPE" /v InstRoot %nul% && ( set error=1 set showfix=1 -call :dk_color2 %Red% "Checking WinPE " %Blue% "[System is running in WinPE mode. Run in normal mode.]" +call :dk_color2 %Red% "Checking WinPE " %Blue% "[WinPE mode found. Run in normal mode.]" ) @@ -1487,15 +1521,10 @@ exit /b :oh_modify -%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';& ([ScriptBlock]::Create($f[1])) '%1';" %nul2% | find /i "Error found" %nul1% && set hasherror=1 +%psc% "$PePath='%1'; $offset='%2'; $f=[io.file]::ReadAllText('!_batp!') -split ':hexedit\:.*';iex ($f[1]);" %nul2% | find /i "Error found" %nul1% && set hasherror=1 exit /b :hexedit: -param ( - [Parameter()] - [String]$PePath -) - # Define dynamic assembly, module, and type $AssemblyBuilder = [AppDomain]::CurrentDomain.DefineDynamicAssembly(4, 1) $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(2, $False) @@ -1510,7 +1539,7 @@ $Imagehlp = $TypeBuilder.CreateType() # File and offset information $PeFile = Get-ChildItem -Path $PePath $timestampOffset = 136 -$exportTimestampOffset = 3076 +$exportTimestampOffset = $offset $checkSumOffset = 216 # Calculate timestamp diff --git a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd index 78a74de..e4cee13 100644 --- a/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd +++ b/MAS/Separate-Files-Version/Activators/Online_KMS_Activation.cmd @@ -1,3 +1,4 @@ +@set masver=2.3 @setlocal DisableDelayedExpansion @echo off @@ -93,7 +94,7 @@ popd cls color 07 -title Online KMS Activation +title Online KMS Activation %masver% :: You are not supposed to edit anything below this. @@ -180,7 +181,7 @@ set "_batp=%_batf:'=''%" set _PSarg="""%~f0""" -el %_args% -set "_ttemp=%temp%" +set "_ttemp=%userprofile%\AppData\Local\Temp" set "_Local=%LocalAppData%" setlocal EnableDelayedExpansion @@ -227,6 +228,35 @@ exit /b ::======================================================================================================================================== +:: Check for updates + +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 +) + +if defined old ( +echo ________________________________________________ +%eline% +echo You are running outdated version MAS %masver% +echo ________________________________________________ +echo: +if not defined _unattended ( +echo [1] Download Latest MAS +echo [0] Continue Anyway +echo: +call :_color %_Green% "Enter a menu option in the Keyboard [1,0] :" +choice /C:10 /N +if !errorlevel!==2 rem +if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b) +) +) +cls + +::======================================================================================================================================== + if %~z0 GEQ 300000 (set "_exitmsg=Go back") else (set "_exitmsg=Exit") :: Check not x86 Windows @@ -274,7 +304,7 @@ if defined _unattended if not defined _unattendedact goto Done ::======================================================================================================================================== -set "_title=Online KMS Activation" +set "_title=Online KMS Activation %masver%" set _gui= :_KMS_Menu @@ -483,7 +513,7 @@ mode con cols=98 lines=31 %psc% "&%_buf%" title %_title% ) else ( -title Online KMS Activation +title Online KMS Activation %masver% ) if defined _gui if %_Debug%==1 mode con cols=98 lines=30 @@ -3277,7 +3307,7 @@ goto :eof cls mode con: cols=91 lines=30 -title Online KMS Complete Uninstall +title Online KMS Complete Uninstall %masver% set "key=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\taskcache\tasks" @@ -3388,7 +3418,7 @@ exit /b cls mode con cols=91 lines=30 -title Install Activation Auto-Renewal +title Install Activation Auto-Renewal %masver% set error_= set "_dest=%ProgramFiles%\Activation-Renewal" @@ -3417,7 +3447,7 @@ if exist "%_temp%\.*" rmdir /s /q "%_temp%\" %nul% call :createInfo.txt %psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":_extracttask\:.*`r`n\"; [io.file]::WriteAllText('%_dest%\Activation_task.cmd', '@REM Dummy ' + '%random%' + [Environment]::NewLine + $f[1].Trim(), [System.Text.Encoding]::ASCII);" -title Install Activation Auto-Renewal +title Install Activation Auto-Renewal %masver% ::======================================================================================================================================== diff --git a/MAS/Separate-Files-Version/Change_Edition.cmd b/MAS/Separate-Files-Version/Change_Edition.cmd index 55de6db..fe23bf6 100644 --- a/MAS/Separate-Files-Version/Change_Edition.cmd +++ b/MAS/Separate-Files-Version/Change_Edition.cmd @@ -1,3 +1,4 @@ +@set masver=2.3 @setlocal DisableDelayedExpansion @echo off @@ -92,7 +93,7 @@ popd cls color 07 -title Change Windows Edition +title Change Windows Edition %masver% set _args= set _elev= @@ -169,7 +170,7 @@ set "_batp=%_batf:'=''%" set _PSarg="""%~f0""" -el %_args% -set "_ttemp=%temp%" +set "_ttemp=%userprofile%\AppData\Local\Temp" setlocal EnableDelayedExpansion @@ -214,6 +215,32 @@ exit /b ::======================================================================================================================================== +:: Check for updates + +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 +) + +if defined old ( +echo ________________________________________________ +%eline% +echo You are running outdated version MAS %masver% +echo ________________________________________________ +echo: +echo [1] Download Latest MAS +echo [0] Continue Anyway +echo: +call :dk_color %_Green% "Enter a menu option in the Keyboard [1,0] :" +choice /C:10 /N +if !errorlevel!==2 rem +if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b) +) + +::======================================================================================================================================== + cls mode 98, 30 @@ -370,7 +397,7 @@ echo "!_target!" | find /i " %%# " %nul1% || set "_target= !_target! %%# " if defined _target ( for %%# in (%_target%) do ( -echo %%# | findstr /i "CountrySpecific CloudEdition" %nul% || (set "_ntarget=!_ntarget! %%#") +echo %%# | findstr /i "CountrySpecific CloudEdition ServerRdsh" %nul% || (set "_ntarget=!_ntarget! %%#") ) ) @@ -462,18 +489,31 @@ goto ced_done :: Changing from Core to Non-Core & Changing editions in Windows build older than 17134 requires "changepk /productkey" or DISM Api method and restart :: In other cases, editions can be changed instantly with "slmgr /ipk" +if %_dismapi%==1 ( +mode con cols=105 lines=40 +%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':checkrebootflag\:.*';iex ($f[1]);" | find /i "True" %nul% && ( +%eline% +echo Pending Reboot flags found. +echo: +echo Restart the system and try again. +goto ced_done +) +) + cls %line% echo: +if defined dismnotworking call :dk_color %_Yellow% "DISM.exe is not responding." echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] echo: if %_dismapi%==1 ( -call :dk_color %Blue% "Notes-" +call :dk_color %Green% "Notes-" echo: echo - Save your work before continue, system will auto restart. echo: echo - You will need to activate with HWID option once the edition is changed. +%line% echo: choice /C:21 /N /M "[1] Continue [2] %_exitmsg% : " if !errorlevel!==1 exit /b @@ -505,7 +545,7 @@ echo Check this page for help. %mas%troubleshoot if %_dismapi%==1 ( echo: -echo Applying the DISM API method with %_chan% Key %key% +echo Applying the DISM API method with %_chan% Key %key%. Please wait... echo: %psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':dismapi\:.*';& ([ScriptBlock]::Create($f[1])) %targetedition% %key%;" timeout /t 3 %nul1% @@ -525,7 +565,16 @@ cls mode con cols=105 lines=32 %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" +%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':checkrebootflag\:.*';iex ($f[1]);" | find /i "True" %nul% && ( +%eline% +echo Pending reboot flags found. +echo: +echo Restart the system and try again. +goto ced_done +) + echo: +if defined dismnotworking call :dk_color %_Yellow% "Note - DISM.exe is not responding." echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] echo: call :dk_color %Blue% "Important - Save your work before continue, system will auto reboot." @@ -574,8 +623,17 @@ goto ced_done ::======================================================================================================================================== +%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':checkrebootflag\:.*';iex ($f[1]);" | find /i "True" %nul% && ( +%eline% +echo Pending reboot flags found. +echo: +echo Restart the system and try again. +goto ced_done +) + cls echo: +if defined dismnotworking call :dk_color %_Yellow% "Note - DISM.exe is not responding." echo Changing the Current Edition [%osedition%] %winbuild% to [%targetedition%] echo: echo Applying the command with %_chan% Key @@ -663,6 +721,30 @@ exit /b ::======================================================================================================================================== +:: Check pending reboot flags + +:checkrebootflag: +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() + if(($status -ne $null) -and $status.RebootPending){ + return $true + } + }catch{} + + return $false +} +Test-PendingReboot +:checkrebootflag: + +::======================================================================================================================================== + :: Get Product Key from pkeyhelper.dll for future new editions :: It works on Windows 10 1803 (17134) and later builds. diff --git a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd index 34cd8a0..686d754 100644 --- a/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd +++ b/MAS/Separate-Files-Version/Extract_OEM_Folder.cmd @@ -1,3 +1,4 @@ +@set masver=2.3 @setlocal DisableDelayedExpansion @echo off @@ -87,7 +88,7 @@ popd cls color 07 -title Extract $OEM$ Folder +title Extract $OEM$ Folder %masver% set _args= set _elev= @@ -161,7 +162,7 @@ set "_batf=%~f0" set "_batp=%_batf:'=''%" set _PSarg="""%~f0""" -el %_args% -set "_ttemp=%temp%" +set "_ttemp=%userprofile%\AppData\Local\Temp" setlocal EnableDelayedExpansion @@ -206,6 +207,33 @@ exit /b ::======================================================================================================================================== +:: Check for updates + +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 +) + +if defined old ( +echo ________________________________________________ +%eline% +echo You are running outdated version MAS %masver% +echo ________________________________________________ +echo: +echo [1] Download Latest MAS +echo [0] Continue Anyway +echo: +call :ex_color %_Green% "Enter a menu option in the Keyboard [1,0] :" +choice /C:10 /N +if !errorlevel!==2 rem +if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b) +) +cls + +::======================================================================================================================================== + setlocal DisableDelayedExpansion :: Check desktop location @@ -336,7 +364,7 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0HWID_Activation.cmd" /HWID +call "%~dp0HWID_Activation.cmd" /HWID cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -370,7 +398,7 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook +call "%~dp0Ohook_Activation.cmd" /Ohook cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -400,7 +428,7 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0KMS38_Activation.cmd" /KMS38 +call "%~dp0KMS38_Activation.cmd" /KMS38 cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -430,7 +458,7 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-WindowsOffice +call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-WindowsOffice cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -466,9 +494,9 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0HWID_Activation.cmd" /HWID +call "%~dp0HWID_Activation.cmd" /HWID -start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook +call "%~dp0Ohook_Activation.cmd" /Ohook cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -500,9 +528,9 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0HWID_Activation.cmd" /HWID +call "%~dp0HWID_Activation.cmd" /HWID -start /b /wait cmd /c "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office +call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -538,9 +566,9 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0KMS38_Activation.cmd" /KMS38 +call "%~dp0KMS38_Activation.cmd" /KMS38 -start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook +call "%~dp0Ohook_Activation.cmd" /Ohook cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -572,9 +600,9 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0KMS38_Activation.cmd" /KMS38 +call "%~dp0KMS38_Activation.cmd" /KMS38 -start /b /wait cmd /c "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office +call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Office cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") @@ -610,9 +638,9 @@ goto done fltmc >nul || exit /b -start /b /wait cmd /c "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Windows +call "%~dp0Online_KMS_Activation.cmd" /KMS-ActAndRenewalTask /KMS-Windows -start /b /wait cmd /c "%~dp0Ohook_Activation.cmd" /Ohook +call "%~dp0Ohook_Activation.cmd" /Ohook cd \ (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") diff --git a/MAS/Separate-Files-Version/Troubleshoot.cmd b/MAS/Separate-Files-Version/Troubleshoot.cmd index cf81042..ca22bdf 100644 --- a/MAS/Separate-Files-Version/Troubleshoot.cmd +++ b/MAS/Separate-Files-Version/Troubleshoot.cmd @@ -1,3 +1,4 @@ +@set masver=2.3 @setlocal DisableDelayedExpansion @echo off @@ -87,7 +88,7 @@ popd cls color 07 -title Troubleshoot +title Troubleshoot %masver% set _args= set _elev= @@ -147,7 +148,7 @@ set "_batp=%_batf:'=''%" set _PSarg="""%~f0""" -el %_args% -set "_ttemp=%temp%" +set "_ttemp=%userprofile%\AppData\Local\Temp" setlocal EnableDelayedExpansion @@ -192,6 +193,33 @@ exit /b ::======================================================================================================================================== +:: Check for updates + +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 +) + +if defined old ( +echo ________________________________________________ +%eline% +echo You are running outdated version MAS %masver% +echo ________________________________________________ +echo: +echo [1] Download Latest MAS +echo [0] Continue Anyway +echo: +call :_color %_Green% "Enter a menu option in the Keyboard [1,0] :" +choice /C:10 /N +if !errorlevel!==2 rem +if !errorlevel!==1 (start ht%-%tps://github.com/mass%-%gravel/Microsoft-Acti%-%vation-Scripts & start %mas% & exit /b) +) +cls + +::======================================================================================================================================== + setlocal DisableDelayedExpansion :: Check desktop location @@ -214,7 +242,7 @@ setlocal EnableDelayedExpansion cls color 07 -title Troubleshoot +title Troubleshoot %masver% mode con cols=77 lines=30 echo: @@ -375,7 +403,7 @@ goto :at_back :retokens cls -mode con cols=115 lines=32 +mode con cols=125 lines=32 %psc% "&{$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=200;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}" title Fix Licensing ^(ClipSVC ^+ Office vNext ^+ SPP ^+ OSPP^) @@ -388,6 +416,8 @@ echo - It helps in troubleshooting activation issues. echo: echo - This option will, echo - Deactivate Windows and Office, you may need to reactivate +echo If Windows is activated with motherboard / OEM / Digital license then don't worry +echo: echo - Clear ClipSVC, Office vNext, SPP and OSPP licenses echo - Fix SPP permissions of tokens folder and registries echo - Trigger the repair option for Office. @@ -508,7 +538,8 @@ for %%# in (wlidsvc LicenseManager) do (net stop %%# /y %nul% & net start %%# /y ::======================================================================================================================================== -:: Clear Office vNext License +:: Find remnants of Office vNext license block and remove it because it stops non vNext licenses from appearing +:: https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state :cleanvnext @@ -547,21 +578,28 @@ echo Deleted Folder - !_Local!\Microsoft\Office\Licenses\ echo Not Found - !_Local!\Microsoft\Office\Licenses\ ) + echo: -for %%# in ( -HKCU\Software\Microsoft\Office\16.0\Common\Licensing -HKCU\Software\Microsoft\Office\16.0\Registration +for /f "tokens=* delims=" %%a in ('%psc% "$userSIDs = Get-WmiObject -Class Win32_UserAccount | ForEach-Object {write-host $_.SID}" %nul6%') do (if defined _sid (set "_sid=!_sid! HKU\%%a") else (set "_sid=HKU\%%a")) + +set regfound= +for %%# in (HKCU !_sid!) do ( +for %%A in ( +%%#\Software\Microsoft\Office\16.0\Common\Licensing +%%#\Software\Microsoft\Office\16.0\Common\Identity +%%#\Software\Microsoft\Office\16.0\Registration ) do ( -reg query %%# %nul% && ( -reg delete %%# /f %nul% && ( -echo Deleted Registry - %%# +reg query %%A %nul% && ( +set regfound=1 +reg delete %%A /f %nul% && ( +echo Deleted Registry - %%A ) || ( -echo Failed to Delete - %%# +echo Failed to Delete - %%A +) ) -) || ( -echo Not Found Registry - %%# ) ) +if not defined regfound echo Not Found - Office vNext Registry Keys ::======================================================================================================================================== -- cgit v1.2.3