mirror of
				https://github.com/massgravel/Microsoft-Activation-Scripts.git
				synced 2025-10-31 15:16:56 +01:00 
			
		
		
		
	Compare commits
	
		
			23 Commits
		
	
	
		
			a149fc5f20
			...
			c89bebdee8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | c89bebdee8 | ||
|  | be7d101df5 | ||
|  | 55b6fce50a | ||
|  | 6566bb53c1 | ||
|  | 2e44a4a77b | ||
|  | 9073a35fe0 | ||
|  | 9f244ddc17 | ||
|  | 8ed0c6874b | ||
|  | a99acbb025 | ||
|  | be867f6616 | ||
|  | fc80735dac | ||
|  | 69c469a997 | ||
|  | 6e74d49721 | ||
|  | ae93f547f5 | ||
|  | 830755f6b6 | ||
|  | b75ba72bc5 | ||
|  | 206c31ece5 | ||
|  | 133d3b9720 | ||
|  | fc2348bf53 | ||
|  | 966fbd14f6 | ||
|  | 691e6088d5 | ||
|  | 74b7c74218 | ||
|  | 4c53e6231b | 
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -100,6 +100,8 @@ set "nul=" | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -239,12 +241,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -274,7 +278,13 @@ goto dk_done | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -356,7 +366,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -1171,7 +1181,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re | |||||||
| if not "%results%%pupfound%"=="" ( | if not "%results%%pupfound%"=="" ( | ||||||
| if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | ||||||
| if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | ||||||
| if defined results call :dk_color %Red% "%results%" | if defined results (call :dk_color %Red% "%results%"&set showfix=1) | ||||||
| set fixes=%fixes% %mas%remove_mal%w%ware | set fixes=%fixes% %mas%remove_mal%w%ware | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | ||||||
| echo: | echo: | ||||||
| @ -1310,7 +1320,7 @@ call :dk_color2 %Red% "Checking Boot Mode                      [%safeboot_option | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ::  https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states | ::  https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states | ||||||
| 
 | 
 | ||||||
| for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | ||||||
| 
 | 
 | ||||||
| @ -1581,7 +1591,7 @@ set "permerror=Error Found In SPP Registries" | |||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| REM  https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application | REM  https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application | ||||||
| 
 | 
 | ||||||
| if not defined permerror ( | if not defined permerror ( | ||||||
| reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | ||||||
| @ -1707,7 +1717,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -103,6 +103,8 @@ set "nul=" | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -242,12 +244,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -277,7 +281,13 @@ goto dk_done | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -359,7 +369,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| cls | cls | ||||||
| @ -1314,7 +1324,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re | |||||||
| if not "%results%%pupfound%"=="" ( | if not "%results%%pupfound%"=="" ( | ||||||
| if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | ||||||
| if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | ||||||
| if defined results call :dk_color %Red% "%results%" | if defined results (call :dk_color %Red% "%results%"&set showfix=1) | ||||||
| set fixes=%fixes% %mas%remove_mal%w%ware | set fixes=%fixes% %mas%remove_mal%w%ware | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | ||||||
| echo: | echo: | ||||||
| @ -1453,7 +1463,7 @@ call :dk_color2 %Red% "Checking Boot Mode                      [%safeboot_option | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ::  https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states | ::  https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states | ||||||
| 
 | 
 | ||||||
| for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | ||||||
| 
 | 
 | ||||||
| @ -1724,7 +1734,7 @@ set "permerror=Error Found In SPP Registries" | |||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| REM  https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application | REM  https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application | ||||||
| 
 | 
 | ||||||
| if not defined permerror ( | if not defined permerror ( | ||||||
| reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | ||||||
| @ -1850,7 +1860,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -100,6 +100,8 @@ set "nul=" | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -247,12 +249,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -282,7 +286,13 @@ goto dk_done | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -364,7 +374,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| cls | cls | ||||||
| @ -529,7 +539,7 @@ call :dk_color %Red% "Checking Installed Office               [Not Found]" | |||||||
| 
 | 
 | ||||||
| if defined ohub ( | if defined ohub ( | ||||||
| echo: | echo: | ||||||
| echo You only have the Office dashboard app installed, you need to install the full version of Office. | echo You only have the Office Dashboard app installed. You need to install the full version of Office. | ||||||
| ) | ) | ||||||
| echo: | echo: | ||||||
| call :dk_color %Blue% "Download and install Office from the below URL and then try again." | call :dk_color %Blue% "Download and install Office from the below URL and then try again." | ||||||
| @ -671,12 +681,12 @@ call :oh_hookinstall | |||||||
| 
 | 
 | ||||||
| ::======================================================================================================================================== | ::======================================================================================================================================== | ||||||
| 
 | 
 | ||||||
| ::  Old version (16.0.9xxxx and below) of Office with subscription license key may show a banner to sign in to fix license issue. | ::  Old version of Office with subscription license key may show a banner to sign in to fix license issue. | ||||||
| ::  Although script applies a Resiliency registry entry to fix that but it doesn't work on old office versions. | ::  Although script applies a Resiliency registry entry to fix that but it doesn't work on old office versions. | ||||||
| ::  Below code checks that condition and informs the user to update the Office. | ::  Below code checks that condition and informs the user to update the Office. | ||||||
| 
 | 
 | ||||||
| if defined _sublic ( | if defined _sublic ( | ||||||
| if not exist "%_oLPath%\Word2019VL_KMS_Client_AE*.xrm-ms" ( | if not exist "%_oLPath%\Word2021VL_KMS_Client_AE*.xrm-ms" ( | ||||||
| call :dk_color %Gray% "Checking Old Office With Sub License    [Found. Update Office, otherwise, it may show a licensing issue-related banner.]" | call :dk_color %Gray% "Checking Old Office With Sub License    [Found. Update Office, otherwise, it may show a licensing issue-related banner.]" | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| @ -1356,7 +1366,7 @@ exit /b | |||||||
| :oh_clearblock | :oh_clearblock | ||||||
| 
 | 
 | ||||||
| ::  Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing | ::  Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing | ||||||
| ::  https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state | ::  https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state | ||||||
| 
 | 
 | ||||||
| set _sidlist= | set _sidlist= | ||||||
| for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) | for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) | ||||||
| @ -1452,12 +1462,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| ::  Clear device-based-licensing | ::  Clear device-based-licensing | ||||||
| ::  https://learn.microsoft.com/deployoffice/device-based-licensing | ::  https://learn.microsoft.com/en-us/deployoffice/device-based-licensing | ||||||
| 
 | 
 | ||||||
| for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% | for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% | ||||||
| 
 | 
 | ||||||
| ::  Remove OEM registry key | ::  Remove OEM registry key | ||||||
| ::  https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 | ::  https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 | ||||||
| 
 | 
 | ||||||
| for %%# in (15 16) do ( | for %%# in (15 16) do ( | ||||||
| reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% | reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% | ||||||
| @ -1701,9 +1711,9 @@ if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISE | |||||||
| 
 | 
 | ||||||
| if defined allapps if %1==0ff1ce15-a989-479d-af46-f275c6370663 ( | if defined allapps if %1==0ff1ce15-a989-479d-af46-f275c6370663 ( | ||||||
| set len=0 | set len=0 | ||||||
| echo:!allapps!> %SystemRoot%\Temp\chklen | echo:!allapps!> "!_ttemp!\chklen" | ||||||
| for %%A in (%SystemRoot%\Temp\chklen) do (set len=%%~zA) | for %%A in ("!_ttemp!\chklen") do (set len=%%~zA) | ||||||
| del %SystemRoot%\Temp\chklen %nul% | del "!_ttemp!\chklen" %nul% | ||||||
| 
 | 
 | ||||||
| if !len! GTR 6000 ( | if !len! GTR 6000 ( | ||||||
| %eline% | %eline% | ||||||
| @ -1832,7 +1842,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re | |||||||
| if not "%results%%pupfound%"=="" ( | if not "%results%%pupfound%"=="" ( | ||||||
| if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | ||||||
| if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | ||||||
| if defined results call :dk_color %Red% "%results%" | if defined results (call :dk_color %Red% "%results%"&set showfix=1) | ||||||
| set fixes=%fixes% %mas%remove_mal%w%ware | set fixes=%fixes% %mas%remove_mal%w%ware | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | ||||||
| echo: | echo: | ||||||
| @ -1971,7 +1981,7 @@ call :dk_color2 %Red% "Checking Boot Mode                      [%safeboot_option | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ::  https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states | ::  https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states | ||||||
| 
 | 
 | ||||||
| for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | ||||||
| 
 | 
 | ||||||
| @ -2242,7 +2252,7 @@ set "permerror=Error Found In SPP Registries" | |||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| REM  https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application | REM  https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application | ||||||
| 
 | 
 | ||||||
| if not defined permerror ( | if not defined permerror ( | ||||||
| reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | ||||||
| @ -2368,7 +2378,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -125,6 +125,8 @@ set "nul=" | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -278,12 +280,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -313,7 +317,13 @@ goto dk_done | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -395,7 +405,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -774,7 +784,7 @@ call :dk_color %Red% "Checking Installed Office               [Not Found]" | |||||||
| 
 | 
 | ||||||
| if defined ohub ( | if defined ohub ( | ||||||
| echo: | echo: | ||||||
| echo You have only Office dashboard app installed, you need to install full Office version. | echo You only have the Office Dashboard app installed. You need to install the full version of Office. | ||||||
| ) | ) | ||||||
| call :dk_color %Blue% "Download and install Office from below URL and try again." | call :dk_color %Blue% "Download and install Office from below URL and try again." | ||||||
| set fixes=%fixes% %mas%genuine-installation-media | set fixes=%fixes% %mas%genuine-installation-media | ||||||
| @ -931,7 +941,7 @@ call :oh_licrefresh | |||||||
| :ks_activate | :ks_activate | ||||||
| 
 | 
 | ||||||
| ::  Opt out of sending KMSclient activation data to Microsoft | ::  Opt out of sending KMSclient activation data to Microsoft | ||||||
| ::  https://learn.microsoft.com/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform | ::  https://learn.microsoft.com/en-us/windows/privacy/manage-connections-from-windows-operating-system-components-to-microsoft-services#19-software-protection-platform | ||||||
| 
 | 
 | ||||||
| if %winbuild% GEQ 9600 ( | 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% | reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f %nul% | ||||||
| @ -999,7 +1009,7 @@ echo Cleared %KS% Server from the registry. | |||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| ::  https://learn.microsoft.com/azure/virtual-desktop/windows-10-multisession-faq | ::  https://learn.microsoft.com/en-us/azure/virtual-desktop/windows-10-multisession-faq | ||||||
| 
 | 
 | ||||||
| if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# ( | if %_actwin%==1 for %%# in (407) do if %osSKU%==%%# ( | ||||||
| call :dk_color %Red% "%winos% does not support activation on non-azure platforms." | call :dk_color %Red% "%winos% does not support activation on non-azure platforms." | ||||||
| @ -1212,6 +1222,10 @@ call :ksdata getinfo !_prod! | |||||||
| if defined _altoffid ( | if defined _altoffid ( | ||||||
| set _License=!_altoffid! | set _License=!_altoffid! | ||||||
| echo Converting Retail To Volume             [!_prod! To !_altoffid!] | echo Converting Retail To Volume             [!_prod! To !_altoffid!] | ||||||
|  | echo %%# | find /i "O365" %nul% && ( | ||||||
|  | if "%oVer%"=="15" (call :dk_color %Gray% "Mondo 2013 is equivalent to O365 [15.0 version] in terms of the latest features.") | ||||||
|  | if "%oVer%"=="16" (call :dk_color %Gray% "Mondo 2016 is equivalent to O365 in terms of the latest features.") | ||||||
|  | ) | ||||||
| set _prod=!_altoffid! | set _prod=!_altoffid! | ||||||
| call :ks_osppready | call :ks_osppready | ||||||
| ) | ) | ||||||
| @ -1330,7 +1344,7 @@ exit /b | |||||||
| :oh_clearblock | :oh_clearblock | ||||||
| 
 | 
 | ||||||
| ::  Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing | ::  Find remnants of Office vNext/shared/device license block and remove it because it stops other licenses from appearing | ||||||
| ::  https://learn.microsoft.com/office/troubleshoot/activation/reset-office-365-proplus-activation-state | ::  https://learn.microsoft.com/en-us/office/troubleshoot/activation/reset-office-365-proplus-activation-state | ||||||
| 
 | 
 | ||||||
| set _sidlist= | set _sidlist= | ||||||
| for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) | for /f "tokens=* delims=" %%a in ('%psc% "$p = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'; Get-ChildItem $p | ForEach-Object { $pi = (Get-ItemProperty """"$p\$($_.PSChildName)"""").ProfileImagePath; if ($pi -like '*\Users\*' -and (Test-Path """"$pi\NTUSER.DAT"""") -and -not ($_.PSChildName -match '\.bak$')) { Split-Path $_.PSPath -Leaf } }" %nul6%') do (if defined _sidlist (set _sidlist=!_sidlist! %%a) else (set _sidlist=%%a)) | ||||||
| @ -1426,12 +1440,12 @@ reg delete HKLM\SOFTWARE\Microsoft\Office\15.0\ClickToRun\Configuration /v Share | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| ::  Clear device-based-licensing | ::  Clear device-based-licensing | ||||||
| ::  https://learn.microsoft.com/deployoffice/device-based-licensing | ::  https://learn.microsoft.com/en-us/deployoffice/device-based-licensing | ||||||
| 
 | 
 | ||||||
| for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% | for /f %%# in ('reg query "%o16c2r_reg%\Configuration" /f *.DeviceBasedLicensing %nul6% ^| findstr REG_') do reg delete "%o16c2r_reg%\Configuration" /v %%# /f %nul% | ||||||
| 
 | 
 | ||||||
| ::  Remove OEM registry key | ::  Remove OEM registry key | ||||||
| ::  https://support.microsoft.com/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 | ::  https://support.microsoft.com/en-us/office/office-repeatedly-prompts-you-to-activate-on-a-new-pc-a9a6b05f-f6ce-4d1f-8d49-eb5007b64ba1 | ||||||
| 
 | 
 | ||||||
| for %%# in (15 16) do ( | for %%# in (15 16) do ( | ||||||
| reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% | reg delete "HKLM\SOFTWARE\Microsoft\Office\%%#.0\Common\OEM" /f %nul% | ||||||
| @ -2675,9 +2689,9 @@ if %_wmic% EQU 0 set "chkapp=for /f "tokens=2 delims==" %%a in ('%psc% "(([WMISE | |||||||
| 
 | 
 | ||||||
| if defined allapps if %1==0ff1ce15-a989-479d-af46-f275c6370663 ( | if defined allapps if %1==0ff1ce15-a989-479d-af46-f275c6370663 ( | ||||||
| set len=0 | set len=0 | ||||||
| echo:!allapps!> %SystemRoot%\Temp\chklen | echo:!allapps!> "!_ttemp!\chklen" | ||||||
| for %%A in (%SystemRoot%\Temp\chklen) do (set len=%%~zA) | for %%A in ("!_ttemp!\chklen") do (set len=%%~zA) | ||||||
| del %SystemRoot%\Temp\chklen %nul% | del "!_ttemp!\chklen" %nul% | ||||||
| 
 | 
 | ||||||
| if !len! GTR 6000 ( | if !len! GTR 6000 ( | ||||||
| %eline% | %eline% | ||||||
| @ -2884,7 +2898,7 @@ if not exist %SysPath%\%_slexe% if not exist %SysPath%\alg.exe (set "results=%re | |||||||
| if not "%results%%pupfound%"=="" ( | if not "%results%%pupfound%"=="" ( | ||||||
| if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | if defined pupfound call :dk_color %Gray% "Checking PUP Activators                 [Found%pupfound%]" | ||||||
| if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | if defined results call :dk_color %Red% "Checking Probable Mal%w%ware Infection..." | ||||||
| if defined results call :dk_color %Red% "%results%" | if defined results (call :dk_color %Red% "%results%"&set showfix=1) | ||||||
| set fixes=%fixes% %mas%remove_mal%w%ware | set fixes=%fixes% %mas%remove_mal%w%ware | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | ||||||
| echo: | echo: | ||||||
| @ -3023,7 +3037,7 @@ call :dk_color2 %Red% "Checking Boot Mode                      [%safeboot_option | |||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| ::  https://learn.microsoft.com/windows-hardware/manufacture/desktop/windows-setup-states | ::  https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-setup-states | ||||||
| 
 | 
 | ||||||
| for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | for /f "skip=2 tokens=2*" %%A in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State" /v ImageState') do (set imagestate=%%B) | ||||||
| 
 | 
 | ||||||
| @ -3294,7 +3308,7 @@ set "permerror=Error Found In SPP Registries" | |||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| REM  https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application | REM  https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application | ||||||
| 
 | 
 | ||||||
| if not defined permerror ( | if not defined permerror ( | ||||||
| reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | ||||||
| @ -3420,7 +3434,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -60,6 +60,8 @@ exit /b | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -192,12 +194,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -227,7 +231,13 @@ goto dk_done | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -309,7 +319,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -323,15 +333,6 @@ echo: | |||||||
| echo Initializing... | echo Initializing... | ||||||
| echo: | echo: | ||||||
| 
 | 
 | ||||||
| if not exist %SysPath%\sppsvc.exe ( |  | ||||||
| %eline% |  | ||||||
| echo [%SysPath%\sppsvc.exe] file is missing. Aborting... |  | ||||||
| echo: |  | ||||||
| set fixes=%fixes% %mas%troubleshoot |  | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" |  | ||||||
| goto dk_done |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| ::======================================================================================================================================== | ::======================================================================================================================================== | ||||||
| 
 | 
 | ||||||
| set spp=SoftwareLicensingProduct | set spp=SoftwareLicensingProduct | ||||||
| @ -365,8 +366,7 @@ if %osedition%==0 ( | |||||||
| %eline% | %eline% | ||||||
| echo Failed to detect OS Edition. Aborting... | echo Failed to detect OS Edition. Aborting... | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" |  | ||||||
| goto dk_done | goto dk_done | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -415,6 +415,7 @@ _updch | |||||||
| _lang | _lang | ||||||
| _clversion | _clversion | ||||||
| _version | _version | ||||||
|  | _AudienceData | ||||||
| _oIds | _oIds | ||||||
| _c2rXml | _c2rXml | ||||||
| _c2rExe | _c2rExe | ||||||
| @ -802,8 +803,40 @@ set errorcode=%errorlevel% | |||||||
| timeout /t 10 %nul% | timeout /t 10 %nul% | ||||||
| 
 | 
 | ||||||
| echo: | echo: | ||||||
|  | set suggestchannel= | ||||||
|  | 
 | ||||||
| if %errorcode% EQU 0 ( | if %errorcode% EQU 0 ( | ||||||
| call :dk_color %Gray% "Now run the Office activation option from the main menu." | if %change%==1 ( | ||||||
|  | echo %targetedition% | find /i "2019Volume" %nul% && ( | ||||||
|  | if not defined ltsc19 set suggestchannel=Production::LTSC | ||||||
|  | if /i not %_AudienceData%==Production::LTSC set suggestchannel=Production::LTSC | ||||||
|  | if /i not %_updch%==F2E724C1-748F-4B47-8FB8-8E0D210E9208 set suggestchannel=Production::LTSC | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | echo %targetedition% | find /i "2021Volume" %nul% && ( | ||||||
|  | if not defined ltsc21 set suggestchannel=Production::LTSC2021 | ||||||
|  | if /i not %_AudienceData%==Production::LTSC2021 set suggestchannel=Production::LTSC2021 | ||||||
|  | if /i not %_updch%==5030841D-C919-4594-8D2D-84AE4F96E58E set suggestchannel=Production::LTSC2021 | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | echo %targetedition% | find /i "2024Volume" %nul% && ( | ||||||
|  | if not defined ltsc24 set suggestchannel=Production::LTSC2024 | ||||||
|  | if /i not %_AudienceData%==Production::LTSC2024 set suggestchannel=Production::LTSC2024 | ||||||
|  | if /i not %_updch%==7983BAC0-E531-40CF-BE00-FD24FE66619C set suggestchannel=Production::LTSC2024 | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | echo %targetedition% | findstr /R "20.*Volume" %nul% || ( | ||||||
|  | if defined ltscfound set suggestchannel=Production::CC | ||||||
|  | echo %_AudienceData% | find /i "LTSC" %nul% && set suggestchannel=Production::CC | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | if defined suggestchannel ( | ||||||
|  | call :dk_color %Gray% "Mismatch found in update channel and installed product." | ||||||
|  | call :dk_color %Blue% "It is recommended to change the update channel to [!suggestchannel!] from the previous menu." | ||||||
|  | ) | ||||||
|  | echo: | ||||||
|  | ) | ||||||
|  | call :dk_color %Gray% "To activate Office, run the activation option from the main menu." | ||||||
| ) else ( | ) else ( | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -980,6 +1013,12 @@ echo Installed Office editions: %_oIds% | |||||||
| echo Unsupported Office edition is installed on your Windows build version %winbuild%. | echo Unsupported Office edition is installed on your Windows build version %winbuild%. | ||||||
| goto :oe_goback | goto :oe_goback | ||||||
| ) | ) | ||||||
|  | if defined ltscfound ( | ||||||
|  | %eline% | ||||||
|  | echo Installed Office update channel: %ltsc19%%ltsc21%%ltsc24% | ||||||
|  | echo Unsupported Office update channel is installed on your Windows build version %winbuild%. | ||||||
|  | goto :oe_goback | ||||||
|  | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| ::=============== | ::=============== | ||||||
| @ -988,49 +1027,52 @@ set inpt= | |||||||
| set counter=0 | set counter=0 | ||||||
| set verified=0 | set verified=0 | ||||||
| set targetFFN= | set targetFFN= | ||||||
|  | set bypassFFN= | ||||||
| set targetchannel= | set targetchannel= | ||||||
| 
 | 
 | ||||||
| %line% | %line% | ||||||
| echo: | echo: | ||||||
| call :dk_color %Gray% "Installed update channel: %_AudienceData%, %_version%, Client: %_clversion%" | call :dk_color %Gray% "Installed update channel: %_AudienceData%, %_version%, Client: %_clversion%" | ||||||
| call :dk_color %Gray% "Unsupported update channels are excluded from this list." | call :dk_color %Gray% "Installed Office editions: %_oIds%" | ||||||
| %line% | %line% | ||||||
| echo: | echo: | ||||||
| 
 | 
 | ||||||
| for %%# in ( | for %%# in ( | ||||||
| "5440FD1F-7ECB-4221-8110-145EFAA6372F_Insider Fast [Beta]  -    Insiders::DevMain" | "5440fd1f-7ecb-4221-8110-145efaa6372f_Insider Fast [Beta]  -    Insiders::DevMain   -" | ||||||
| "64256AFE-F5D9-4F86-8936-8840A6A4F5BE_Monthly Preview      -    Insiders::CC" | "64256afe-f5d9-4f86-8936-8840a6a4f5be_Monthly Preview      -    Insiders::CC        -" | ||||||
| "492350F6-3A01-4F97-B9C0-C7C6DDF67D60_Monthly [Current]    -  Production::CC" | "492350f6-3a01-4f97-b9c0-c7c6ddf67d60_Monthly [Current]    -  Production::CC        -" | ||||||
| "55336B82-A18D-4DD6-B5F6-9E5095C314A6_Monthly Enterprise   -  Production::MEC" | "55336b82-a18d-4dd6-b5f6-9e5095c314a6_Monthly Enterprise   -  Production::MEC       -" | ||||||
| "B8F9B850-328D-4355-9145-C59439A0C4CF_Semi Annual Preview  -    Insiders::FRDC" | "b8f9b850-328d-4355-9145-c59439a0c4cf_Semi Annual Preview  -    Insiders::FRDC      -" | ||||||
| "7FFBC6BF-BC32-4F92-8982-F9DD17FD3114_Semi Annual          -  Production::DC" | "7ffbc6bf-bc32-4f92-8982-f9dd17fd3114_Semi Annual          -  Production::DC        -" | ||||||
| "EA4A4090-DE26-49D7-93C1-91BFF9E53FC3_DevMain Channel      -     Dogfood::DevMain" | "ea4a4090-de26-49d7-93c1-91bff9e53fc3_DevMain Channel      -     Dogfood::DevMain   -" | ||||||
| "B61285DD-D9F7-41F2-9757-8F61CBA4E9C8_Microsoft Elite      -   Microsoft::DevMain" | "b61285dd-d9f7-41f2-9757-8f61cba4e9c8_Microsoft Elite      -   Microsoft::DevMain   -" | ||||||
| "F2E724C1-748F-4B47-8FB8-8E0D210E9208_Perpetual2019 VL     -  Production::LTSC" | "f2e724c1-748f-4b47-8fb8-8e0d210e9208_Perpetual2019 VL     -  Production::LTSC      -" | ||||||
| "1D2D2EA6-1680-4C56-AC58-A441C8C24FF9_Microsoft2019 VL     -   Microsoft::LTSC" | "1d2d2ea6-1680-4c56-ac58-a441c8c24ff9_Microsoft2019 VL     -   Microsoft::LTSC      -" | ||||||
| "5030841D-C919-4594-8D2D-84AE4F96E58E_Perpetual2021 VL     -  Production::LTSC2021" | "5030841d-c919-4594-8d2d-84ae4f96e58e_Perpetual2021 VL     -  Production::LTSC2021  -" | ||||||
| "86752282-5841-4120-AC80-DB03AE6B5FDB_Microsoft2021 VL     -   Microsoft::LTSC2021" | "86752282-5841-4120-ac80-db03ae6b5fdb_Microsoft2021 VL     -   Microsoft::LTSC2021  -" | ||||||
| "7983BAC0-E531-40CF-BE00-FD24FE66619C_Perpetual2024 VL     -  Production::LTSC2024" | "7983bac0-e531-40cf-be00-fd24fe66619c_Perpetual2024 VL     -  Production::LTSC2024  -" | ||||||
| "C02D8FE6-5242-4DA8-972F-82EE55E00671_Microsoft2024 VL     -   Microsoft::LTSC2024" | "c02d8fe6-5242-4da8-972f-82ee55e00671_Microsoft2024 VL     -   Microsoft::LTSC2024  -" | ||||||
| ) do ( | ) do ( | ||||||
| for /f "tokens=1-2 delims=_" %%A in ("%%~#") do ( | for /f "tokens=1-2 delims=_" %%A in ("%%~#") do ( | ||||||
|  | set bypass= | ||||||
| set supported= | set supported= | ||||||
| if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1) | if %winbuild% LSS 10240 (echo %%B | findstr /i "LTSC DevMain" %nul% || set supported=1) else (set supported=1) | ||||||
| if %winbuild% GEQ 10240 ( | if %winbuild% GEQ 10240 ( | ||||||
| if defined ltsc19 echo %%B | find /i "2019 VL" %nul% || set supported= | if defined ltsc19 echo %%B | find /i "2019 VL" %nul% || set bypass=1 | ||||||
| if defined ltsc21 echo %%B | find /i "2021 VL" %nul% || set supported= | if defined ltsc21 echo %%B | find /i "2021 VL" %nul% || set bypass=1 | ||||||
| if defined ltsc24 echo %%B | find /i "2024 VL" %nul% || set supported= | if defined ltsc24 echo %%B | find /i "2024 VL" %nul% || set bypass=1 | ||||||
| if not defined ltscfound echo %%B | find /i "LTSC" %nul% && set supported= | if not defined ltscfound echo %%B | find /i "LTSC" %nul% && set bypass=1 | ||||||
| ) | ) | ||||||
| if defined supported ( | if defined supported ( | ||||||
| set /a counter+=1 | set /a counter+=1 | ||||||
| if !counter! LSS 10 ( | if !counter! LSS 10 ( | ||||||
| echo [!counter!]  %%B | if defined bypass (echo [!counter!]  %%B  Unofficial change method will be used) else (echo [!counter!]  %%B) | ||||||
| ) else ( | ) else ( | ||||||
| echo [!counter!] %%B | if defined bypass (echo [!counter!] %%B  Unofficial change method will be used) else (echo [!counter!] %%B) | ||||||
| ) | ) | ||||||
| set targetFFN!counter!=%%A | set targetFFN!counter!=%%A | ||||||
| set targetchannel!counter!=%%B | set targetchannel!counter!=%%B | ||||||
|  | if defined bypass set bypassFFN=!bypassFFN!%%A | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| @ -1044,7 +1086,7 @@ call :dk_color %_Green% "Enter an option number using your keyboard and press En | |||||||
| set /p inpt= | set /p inpt= | ||||||
| if "%inpt%"=="" goto :oe_changeupdchnl | if "%inpt%"=="" goto :oe_changeupdchnl | ||||||
| if "%inpt%"=="0" goto :oemenu | if "%inpt%"=="0" goto :oemenu | ||||||
| if /i "%inpt%"=="R" start https://learn.microsoft.com/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl | if /i "%inpt%"=="R" start https://learn.microsoft.com/en-us/microsoft-365-apps/updates/overview-update-channels & goto :oe_changeupdchnl | ||||||
| for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1) | for /l %%i in (1,1,%counter%) do (if "%inpt%"=="%%i" set verified=1) | ||||||
| set targetFFN=!targetFFN%inpt%! | set targetFFN=!targetFFN%inpt%! | ||||||
| set targetchannel=!targetchannel%inpt%! | set targetchannel=!targetchannel%inpt%! | ||||||
| @ -1061,15 +1103,133 @@ set build= | |||||||
| for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getbuild\:.*';iex ($f[1])" %nul6%') do (set build=%%a) | for /f "delims=" %%a in ('%psc% "$f=[io.file]::ReadAllText('!_batp!') -split ':getbuild\:.*';iex ($f[1])" %nul6%') do (set build=%%a) | ||||||
| echo "%build%" | find /i "16." %nul% || set build= | echo "%build%" | find /i "16." %nul% || set build= | ||||||
| 
 | 
 | ||||||
|  | echo: | ||||||
|  | for /f "tokens=1 delims=-" %%A in ("%targetchannel%") do (echo Target update channel: %%A) | ||||||
|  | echo Target build number: %build% | ||||||
|  | echo: %bypassFFN% | find /i "%targetFFN%" %nul% && goto :oe_changeunoff | ||||||
|  | 
 | ||||||
|  | call :oe_cleanupreg | ||||||
|  | 
 | ||||||
|  | if not defined build ( | ||||||
|  | if %winbuild% GEQ 9200 call :dk_color %Gray% "Failed to detect build number for the target FFN." | ||||||
|  | set "updcommand="%_c2rCexe%" /update user" | ||||||
|  | ) else ( | ||||||
|  | set "updcommand="%_c2rCexe%" /update user updatetoversion=%build%" | ||||||
|  | ) | ||||||
|  | echo Running the below command to trigger updates... | ||||||
|  | echo: | ||||||
|  | echo %updcommand% | ||||||
|  | %updcommand% | ||||||
|  | echo: | ||||||
|  | echo Check this webpage for help - %mas%troubleshoot | ||||||
|  | goto :oe_goback | ||||||
|  | 
 | ||||||
|  | ::======================= | ||||||
|  | 
 | ||||||
|  | ::  Unofficial method to change channel | ||||||
|  | 
 | ||||||
|  | :oe_changeunoff | ||||||
|  | 
 | ||||||
|  | set abortchange= | ||||||
|  | echo %targetchannel% | find /i "2019 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2019Volume" %nul% || set abortchange=1)) | ||||||
|  | echo %targetchannel% | find /i "2021 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2021Volume" %nul% || set abortchange=1)) | ||||||
|  | echo %targetchannel% | find /i "2024 VL" %nul% && (for %%A in (%_oIds%) do (echo %%A | find /i "2024Volume" %nul% || set abortchange=1)) | ||||||
|  | 
 | ||||||
|  | if defined abortchange ( | ||||||
|  | %eline% | ||||||
|  | echo Mismatch found in installed Office products and target update channel. Aborting... | ||||||
|  | echo Non-perpetual Office products are not suppported with Perpetual VL update channels. | ||||||
|  | goto :oe_goback | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | if not defined build ( | ||||||
|  | %eline% | ||||||
|  | call :dk_color %Red% "Failed to detect build number for the target FFN." | ||||||
|  | echo: | ||||||
|  | set fixes=%fixes% %mas%troubleshoot | ||||||
|  | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
|  | goto :oe_goback | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | set buildchk=0 | ||||||
|  | for /f "tokens=3 delims=." %%a in ("%build%") do set "buildchk=%%a" | ||||||
|  | 
 | ||||||
|  | set "c2rcommand="%_c2rExe%" platform=%_oArch% culture=%_lang% productstoadd=%_firstoId%.16_%_lang%_x-none cdnbaseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% baseurl.16=http://officecdn.microsoft.com/pr/%targetFFN% version.16=%build% mediatype.16=CDN sourcetype.16=CDN deliverymechanism=%targetFFN% %_firstoId%.excludedapps.16=%_firstoIdExcludelist% flt.useteamsaddon=disabled flt.usebingaddononinstall=disabled flt.usebingaddononupdate=disabled" | ||||||
|  | set "c2rclientupdate=!c2rcommand! scenario=CLIENTUPDATE" | ||||||
|  | 
 | ||||||
|  | if %clverchk% LSS %buildchk% ( | ||||||
|  | echo: | ||||||
|  | call :dk_color %Blue% "Do not terminate the operation before it completes..." | ||||||
|  | echo: | ||||||
|  | echo Updating Office C2R client with the command below, please wait... | ||||||
|  | echo: | ||||||
|  | echo %c2rclientupdate% | ||||||
|  | %c2rclientupdate% | ||||||
|  | for /l %%i in (1,1,30) do (if !clverchk! LSS %buildchk% (call :ch_getinfo&timeout /t 10 %nul%)) | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | if %clverchk% LSS %buildchk% ( | ||||||
|  | echo: | ||||||
|  | call :dk_color %Red% "Failed to update Office C2R client. Aborting..." | ||||||
|  | echo: | ||||||
|  | set fixes=%fixes% %mas%troubleshoot | ||||||
|  | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
|  | goto :oe_goback | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | call :oe_cleanupreg | ||||||
|  | 
 | ||||||
|  | echo Running the below command to change update channel, please wait... | ||||||
|  | echo: | ||||||
|  | echo %c2rcommand% | ||||||
|  | %c2rcommand% | ||||||
|  | set errorcode=%errorlevel% | ||||||
|  | timeout /t 10 %nul% | ||||||
|  | 
 | ||||||
|  | echo: | ||||||
|  | if %errorcode% EQU 0 ( | ||||||
|  | call :dk_color %Gray% "Now run the Office activation option from the main menu." | ||||||
|  | ) else ( | ||||||
|  | set fixes=%fixes% %mas%troubleshoot | ||||||
|  | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | ::======================================================================================================================================== | ||||||
|  | 
 | ||||||
|  | :oe_goback | ||||||
|  | 
 | ||||||
|  | call :oe_tempcleanup | ||||||
|  | 
 | ||||||
|  | echo: | ||||||
|  | if defined fixes ( | ||||||
|  | call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | ||||||
|  | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
|  | choice /C:10 /N | ||||||
|  | if !errorlevel!==2 goto :oemenu | ||||||
|  | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | if defined terminal ( | ||||||
|  | call :dk_color %_Yellow% "Press [0] key to go back..." | ||||||
|  | choice /c 0 /n | ||||||
|  | ) else ( | ||||||
|  | call :dk_color %_Yellow% "Press any key to go back..." | ||||||
|  | pause %nul1% | ||||||
|  | ) | ||||||
|  | goto :oemenu | ||||||
|  | 
 | ||||||
|  | ::======================================================================================================================================== | ||||||
|  | 
 | ||||||
|  | :oe_cleanupreg | ||||||
|  | 
 | ||||||
| ::  Cleanup Office update related registries, thanks to @abbodi1406 | ::  Cleanup Office update related registries, thanks to @abbodi1406 | ||||||
| ::  https://techcommunity.microsoft.com/t5/office-365-blog/how-to-manage-office-365-proplus-channels-for-it-pros/ba-p/795813 | ::  https://techcommunity.microsoft.com/t5/office-365-blog/how-to-manage-office-365-proplus-channels-for-it-pros/ba-p/795813 | ||||||
| ::  https://learn.microsoft.com/en-us/microsoft-365-apps/updates/change-update-channels#considerations-when-changing-channels | ::  https://learn.microsoft.com/en-us/microsoft-365-apps/updates/change-update-channels#considerations-when-changing-channels | ||||||
| 
 | 
 | ||||||
| echo: |  | ||||||
| for /f "tokens=1 delims=-" %%A in ("%targetchannel%") do (echo Target update channel: %%A) |  | ||||||
| echo: | echo: | ||||||
| echo Cleaning Office update registry keys... | echo Cleaning Office update registry keys... | ||||||
| echo Adding new update channel to registry keys... | echo Adding new update channel to registry keys... | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| %nul% reg add %o16c2r_reg%\Configuration /v CDNBaseUrl /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f | %nul% reg add %o16c2r_reg%\Configuration /v CDNBaseUrl /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f | ||||||
| %nul% reg add %o16c2r_reg%\Configuration /v UpdateChannel /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f | %nul% reg add %o16c2r_reg%\Configuration /v UpdateChannel /t REG_SZ /d "https://officecdn.microsoft.com/pr/%targetFFN%" /f | ||||||
| @ -1086,43 +1246,7 @@ echo Adding new update channel to registry keys... | |||||||
| %nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f /reg:32 | %nul% reg delete HKLM\SOFTWARE\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f /reg:32 | ||||||
| %nul% reg delete HKCU\Software\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f | %nul% reg delete HKCU\Software\Policies\Microsoft\cloud\office\16.0\Common\officeupdate /f | ||||||
| 
 | 
 | ||||||
| if not defined build ( | exit /b | ||||||
| if %winbuild% GEQ 9200 call :dk_color %Gray% "Failed to detect build number for the target FFN." |  | ||||||
| set "updcommand="%_c2rCexe%" /update user" |  | ||||||
| ) else ( |  | ||||||
| set "updcommand="%_c2rCexe%" /update user updatetoversion=%build%" |  | ||||||
| ) |  | ||||||
| echo Running the below command to trigger updates... |  | ||||||
| echo: |  | ||||||
| echo %updcommand% |  | ||||||
| %updcommand% |  | ||||||
| echo: |  | ||||||
| echo Check this webpage for help - %mas%troubleshoot |  | ||||||
| goto :oe_goback |  | ||||||
| 
 |  | ||||||
| ::======================================================================================================================================== |  | ||||||
| 
 |  | ||||||
| :oe_goback |  | ||||||
| 
 |  | ||||||
| call :oe_tempcleanup |  | ||||||
| 
 |  | ||||||
| echo: |  | ||||||
| if defined fixes ( |  | ||||||
| call :dk_color %White% "Follow ALL the ABOVE blue lines.   " |  | ||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" |  | ||||||
| choice /C:10 /N |  | ||||||
| if !errorlevel!==2 goto :oemenu |  | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) |  | ||||||
| ) |  | ||||||
| 
 |  | ||||||
| if defined terminal ( |  | ||||||
| call :dk_color %_Yellow% "Press [0] key to go back..." |  | ||||||
| choice /c 0 /n |  | ||||||
| ) else ( |  | ||||||
| call :dk_color %_Yellow% "Press any key to go back..." |  | ||||||
| pause %nul1% |  | ||||||
| ) |  | ||||||
| goto :oemenu |  | ||||||
| 
 | 
 | ||||||
| ::======================================================================================================================================== | ::======================================================================================================================================== | ||||||
| 
 | 
 | ||||||
| @ -1145,6 +1269,7 @@ set _oRoot= | |||||||
| set _oArch= | set _oArch= | ||||||
| set _updch= | set _updch= | ||||||
| set _oIds= | set _oIds= | ||||||
|  | set _firstoId= | ||||||
| set _lang= | set _lang= | ||||||
| set _cfolder= | set _cfolder= | ||||||
| set _version= | set _version= | ||||||
| @ -1175,9 +1300,13 @@ for /f "tokens=%_tok% delims=\" %%a in ('reg query "%o16c2r_reg%\ProductReleaseI | |||||||
| if defined _oIds (set "_oIds=!_oIds! %%a") else (set "_oIds=%%a") | if defined _oIds (set "_oIds=!_oIds! %%a") else (set "_oIds=%%a") | ||||||
| ) | ) | ||||||
| set _oIds=%_oIds:.16=% | set _oIds=%_oIds:.16=% | ||||||
|  | for /f "tokens=1" %%A in ("%_oIds%") do set _firstoId=%%A | ||||||
|  | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\Configuration /v %_firstoId%.ExcludedApps" %nul6%') do (set "_firstoIdExcludelist=%%b") | ||||||
| 
 | 
 | ||||||
| set verchk=0 | set verchk=0 | ||||||
|  | set clverchk=0 | ||||||
| for /f "tokens=3 delims=." %%a in ("%_version%") do set "verchk=%%a" | for /f "tokens=3 delims=." %%a in ("%_version%") do set "verchk=%%a" | ||||||
|  | for /f "tokens=3 delims=." %%a in ("%_clversion%") do set "clverchk=%%a" | ||||||
| 
 | 
 | ||||||
| if exist "%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" set "_c2rXml=%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" | if exist "%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" set "_c2rXml=%_oRoot%\Licenses16\c2rpridslicensefiles_auto.xml" | ||||||
| 
 | 
 | ||||||
| @ -1193,16 +1322,13 @@ if exist "%_cfolder%\OfficeC2RClient.exe" ( | |||||||
| set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe" | set "_c2rCexe=%_cfolder%\OfficeC2RClient.exe" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| set "audidata4=%_AudienceData:~-4%" | ::  Check LTSC version files | ||||||
| 
 | 
 | ||||||
| if /i "%audidata4%"=="LTSC" set ltsc19=LTSC | for /f "skip=2 tokens=2*" %%a in ('"reg query %o16c2r_reg%\ProductReleaseIDs\%_actconfig%" /s %nul6%') do ( | ||||||
| echo %_clversion% %_version% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC | echo "%%b" %nul2% | findstr "16.0.103 16.0.104 16.0.105" %nul% && set ltsc19=LTSC | ||||||
| 
 | echo "%%b" %nul2% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021 | ||||||
| if /i "%audidata4%"=="2021" set ltsc21=LTSC2021 | echo "%%b" %nul2% | findstr "16.0.17932" %nul% && set ltsc24=LTSC2024 | ||||||
| echo %_clversion% %_version% | findstr "16.0.14332" %nul% && set ltsc21=LTSC2021 | ) | ||||||
| 
 |  | ||||||
| if /i "%audidata4%"=="2024" set ltsc24=LTSC2024 |  | ||||||
| ::  LTSC 2024 build is not fixed yet |  | ||||||
| 
 | 
 | ||||||
| if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1 | if not "%ltsc19%%ltsc21%%ltsc24%"=="" set ltscfound=1 | ||||||
| 
 | 
 | ||||||
| @ -1477,7 +1603,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -65,6 +65,8 @@ exit /b | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -197,12 +199,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -232,7 +236,13 @@ goto dk_done | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -314,7 +324,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -390,8 +400,7 @@ if not defined allapps ( | |||||||
| %eline% | %eline% | ||||||
| echo Failed to find activation IDs. Aborting... | echo Failed to find activation IDs. Aborting... | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" |  | ||||||
| goto dk_done | goto dk_done | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -413,8 +422,7 @@ if not defined osedition ( | |||||||
| %eline% | %eline% | ||||||
| echo Failed to detect OS edition, aborting... | echo Failed to detect OS edition, aborting... | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | call :dk_color %Blue% "To fix this issue, activate Windows from the main menu." | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" |  | ||||||
| goto dk_done | goto dk_done | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -795,7 +803,7 @@ exit /b | |||||||
| 
 | 
 | ||||||
| ::  https://stackoverflow.com/a/46268232 | ::  https://stackoverflow.com/a/46268232 | ||||||
| 
 | 
 | ||||||
| set "ddf="%SystemRoot%\Temp\ddf"" | set "ddf="%SystemRoot%\Temp\%Random%%Random%%Random%%Random%"" | ||||||
| %nul% del /q /f %ddf% | %nul% del /q /f %ddf% | ||||||
| echo/.New Cabinet>%ddf% | echo/.New Cabinet>%ddf% | ||||||
| echo/.set Cabinet=ON>>%ddf% | echo/.set Cabinet=ON>>%ddf% | ||||||
| @ -1058,7 +1066,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -60,6 +60,8 @@ exit /b | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -208,12 +210,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -243,7 +247,13 @@ goto done2 | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -325,7 +335,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -732,7 +742,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| @set masver=3.2 | @set masver=3.3 | ||||||
| @echo off | @echo off | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -60,6 +60,8 @@ exit /b | |||||||
| 
 | 
 | ||||||
| set "blank=" | set "blank=" | ||||||
| set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | ||||||
|  | set "github=ht%blank%tps%blank%://github.com/massgra%blank%vel/Micro%blank%soft-Acti%blank%vation-Scripts" | ||||||
|  | set "selfgit=ht%blank%tps%blank%://git.acti%blank%vated.win/massg%blank%rave/Micr%blank%osoft-Act%blank%ivation-Scripts" | ||||||
| 
 | 
 | ||||||
| ::  Check if Null service is working, it's important for the batch script | ::  Check if Null service is working, it's important for the batch script | ||||||
| 
 | 
 | ||||||
| @ -209,12 +211,14 @@ for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[ | |||||||
| 
 | 
 | ||||||
| if /i not "%tstresult%"=="FullLanguage" ( | if /i not "%tstresult%"=="FullLanguage" ( | ||||||
| %eline% | %eline% | ||||||
| echo: %tstresult% | for /f "delims=" %%a in ('%psc% "$ExecutionContext.SessionState.LanguageMode" %nul6%') do (set tstresult2=%%a) | ||||||
| cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | echo Test 1 - %tstresult% | ||||||
|  | echo Test 2 - !tstresult2! | ||||||
|  | echo: | ||||||
| 
 | 
 | ||||||
| REM check LanguageMode | REM check LanguageMode | ||||||
| 
 | 
 | ||||||
| cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | echo: !tstresult2! | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | ||||||
| echo FullLanguage mode not found in PowerShell. Aborting... | echo FullLanguage mode not found in PowerShell. Aborting... | ||||||
| echo If you have applied restrictions on Powershell then undo those changes. | echo If you have applied restrictions on Powershell then undo those changes. | ||||||
| echo: | echo: | ||||||
| @ -244,7 +248,13 @@ goto dk_done | |||||||
| REM check antivirus and other errors | REM check antivirus and other errors | ||||||
| 
 | 
 | ||||||
| echo PowerShell is not working properly. Aborting... | echo PowerShell is not working properly. Aborting... | ||||||
| cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { if ($i.displayName -notlike '*windows*') { $n += $i.displayName } }; if ($n) { Write-Host ('Installed 3rd party Antivirus might be blocking the script - ' + ($n -join ', ')) -ForegroundColor White -BackgroundColor Blue }""" | 
 | ||||||
|  | if /i "!tstresult2!"=="FullLanguage" ( | ||||||
|  | echo: | ||||||
|  | echo Your antivirus software might be blocking the script, or PowerShell on your system might be corrupted. | ||||||
|  | cmd /c "%psc% ""$av = Get-WmiObject -Namespace root\SecurityCenter2 -Class AntiVirusProduct; $n = @(); foreach ($i in $av) { $n += $i.displayName }; if ($n) { Write-Host ('Installed Antivirus - ' + ($n -join ', '))}""" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
| echo: | echo: | ||||||
| set fixes=%fixes% %mas%troubleshoot | set fixes=%fixes% %mas%troubleshoot | ||||||
| call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | ||||||
| @ -326,7 +336,7 @@ echo: | |||||||
| call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 rem | if !errorlevel!==2 rem | ||||||
| if !errorlevel!==1 (start %mas% & exit /b) | if !errorlevel!==1 (start %selfgit% & start %github% & start %mas% & exit /b) | ||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| @ -387,7 +397,7 @@ if %_erl%==5 goto:retokens | |||||||
| if %_erl%==4 goto:fixwmi | if %_erl%==4 goto:fixwmi | ||||||
| if %_erl%==3 goto:sfcscan | if %_erl%==3 goto:sfcscan | ||||||
| if %_erl%==2 goto:dism_rest | if %_erl%==2 goto:dism_rest | ||||||
| if %_erl%==1 start %mas%troubleshoot.html &goto at_menu | if %_erl%==1 (start %selfgit% & start %github% & start %mas%troubleshoot & goto at_menu) | ||||||
| goto :at_menu | goto :at_menu | ||||||
| 
 | 
 | ||||||
| ::======================================================================================================================================== | ::======================================================================================================================================== | ||||||
| @ -733,7 +743,7 @@ for %%# in (SppE%w%xtComObj.exe %_slexe%) do (reg delete "HKLM\SOFTWARE\Microsof | |||||||
| 
 | 
 | ||||||
| if %winbuild% LSS 9200 if not defined _vis ( | if %winbuild% LSS 9200 if not defined _vis ( | ||||||
| REM Fix issues caused by Update KB971033 in Windows 7 | REM Fix issues caused by Update KB971033 in Windows 7 | ||||||
| REM https://support.microsoft.com/help/4487266 | REM https://support.microsoft.com/en-us/help/4487266 | ||||||
| echo: | echo: | ||||||
| echo Checking Update KB971033... | echo Checking Update KB971033... | ||||||
| %psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul% | %psc% "if (Get-Hotfix -Id KB971033 -ErrorAction SilentlyContinue) {Exit 3}" %nul% | ||||||
| @ -1178,7 +1188,7 @@ goto :at_menu | |||||||
| 
 | 
 | ||||||
| ::  https://stackoverflow.com/a/46268232 | ::  https://stackoverflow.com/a/46268232 | ||||||
| 
 | 
 | ||||||
| set "ddf="%SystemRoot%\Temp\ddf"" | set "ddf="%SystemRoot%\Temp\%Random%%Random%%Random%%Random%"" | ||||||
| %nul% del /q /f %ddf% | %nul% del /q /f %ddf% | ||||||
| echo/.New Cabinet>%ddf% | echo/.New Cabinet>%ddf% | ||||||
| echo/.set Cabinet=ON>>%ddf% | echo/.set Cabinet=ON>>%ddf% | ||||||
| @ -1230,7 +1240,7 @@ set "permerror=Error Found In SPP Registries" | |||||||
| ) | ) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| REM  https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application | REM  https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application | ||||||
| 
 | 
 | ||||||
| if not defined permerror ( | if not defined permerror ( | ||||||
| reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | reg query "HKU\S-1-5-20\Software\Microsoft\Windows NT\CurrentVersion" %nul% && ( | ||||||
| @ -1276,7 +1286,7 @@ if ($env:permerror -eq 'Error Found In SPP Registries') { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| # Fix perms for SPP in HKU\S-1-5-20 | # Fix perms for SPP in HKU\S-1-5-20 | ||||||
| # https://learn.microsoft.com/office/troubleshoot/activation/license-issue-when-start-office-application | # https://learn.microsoft.com/en-us/office/troubleshoot/activation/license-issue-when-start-office-application | ||||||
| 
 | 
 | ||||||
| if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') { | if ($env:permerror -ne 'Error Found In S-1-5-20 SPP') { | ||||||
|     exit |     exit | ||||||
| @ -1489,7 +1499,7 @@ call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | |||||||
| call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | ||||||
| choice /C:10 /N | choice /C:10 /N | ||||||
| if !errorlevel!==2 exit /b | if !errorlevel!==2 exit /b | ||||||
| if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | if !errorlevel!==1 (start %selfgit% & start %github% & for %%# in (%fixes%) do (start %%#)) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| if defined terminal ( | if defined terminal ( | ||||||
|  | |||||||
							
								
								
									
										10
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
									
									
									
									
								
							| @ -22,9 +22,7 @@ Alternatively, you can use the following (this will be deprecated in the future) | |||||||
| irm https://massgrave.dev/get | iex | irm https://massgrave.dev/get | iex | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| 3.   You will see the activation options.   | 3.   You will see the activation options. Choose the activation options highlighted in green.  | ||||||
| 	   Press 1 HWID for Windows activation.   |  | ||||||
|      Press 2 Ohook for Office activation. |  | ||||||
| 
 | 
 | ||||||
| 4.   That's all | 4.   That's all | ||||||
| 
 | 
 | ||||||
| @ -49,7 +47,7 @@ or | |||||||
| 
 | 
 | ||||||
| --- | --- | ||||||
| 
 | 
 | ||||||
| - **[Office for macOS](https://massgrave.dev/office_for_mac)** | - To activate additional products such as **Office for macOS, Visual Studio, RDS CALs, and Windows XP**, check [here](https://massgrave.dev/unsupported_products_activation). | ||||||
| - To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches). | - To run the scripts in unattended mode, check [here](https://massgrave.dev/command_line_switches). | ||||||
| 
 | 
 | ||||||
| --- | --- | ||||||
| @ -71,8 +69,8 @@ or | |||||||
| --- | --- | ||||||
| 
 | 
 | ||||||
| ``` | ``` | ||||||
| Latest Version: 3.2 | Latest Version: 3.3 | ||||||
| Release date: 6-May-2025 | Release date: 1-June-2025 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| ### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) | ### [Troubleshooting / Help](https://massgrave.dev/troubleshoot) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user