| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | @set masver=3.0 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-15 22:03:20 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | ::============================================================================ | 
					
						
							|  |  |  | :: | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | ::   Homepage: mass grave[.]dev | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ::      Email: mas.help@outlook.com | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | :: | 
					
						
							|  |  |  | ::============================================================================ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | ::  Set environment variables, it helps if they are misconfigured in the system | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | setlocal EnableExtensions | 
					
						
							|  |  |  | setlocal DisableDelayedExpansion | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set "PathExt=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set "SysPath=%SystemRoot%\System32" | 
					
						
							|  |  |  | set "Path=%SystemRoot%\System32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SystemRoot%\System32\WindowsPowerShell\v1.0\" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | if exist "%SystemRoot%\Sysnative\reg.exe" ( | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set "SysPath=%SystemRoot%\Sysnative" | 
					
						
							|  |  |  | set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%SystemRoot%\Sysnative\WindowsPowerShell\v1.0\;%Path%" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set "ComSpec=%SysPath%\cmd.exe" | 
					
						
							|  |  |  | set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules" | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-30 15:49:09 +01:00
										 |  |  | set re1= | 
					
						
							|  |  |  | set re2= | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | set "_cmdf=%~f0" | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | for %%# in (%*) do ( | 
					
						
							| 
									
										
										
										
											2024-10-30 15:49:09 +01:00
										 |  |  | if /i "%%#"=="re1" set re1=1 | 
					
						
							|  |  |  | if /i "%%#"=="re2" set re2=1 | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | :: Re-launch the script with x64 process if it was initiated by x86 process on x64 bit Windows | 
					
						
							|  |  |  | :: or with ARM64 process if it was initiated by x86/ARM32 process on ARM64 Windows | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-30 05:59:31 +01:00
										 |  |  | if exist %SystemRoot%\Sysnative\cmd.exe if not defined re1 ( | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | setlocal EnableDelayedExpansion | 
					
						
							| 
									
										
										
										
											2024-10-30 05:59:31 +01:00
										 |  |  | start %SystemRoot%\Sysnative\cmd.exe /c ""!_cmdf!" %* re1" | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | exit /b | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :: Re-launch the script with ARM32 process if it was initiated by x64 process on ARM64 Windows | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-30 05:59:31 +01:00
										 |  |  | if exist %SystemRoot%\SysArm32\cmd.exe if %PROCESSOR_ARCHITECTURE%==AMD64 if not defined re2 ( | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | setlocal EnableDelayedExpansion | 
					
						
							| 
									
										
										
										
											2024-10-30 05:59:31 +01:00
										 |  |  | start %SystemRoot%\SysArm32\cmd.exe /c ""!_cmdf!" %* re2" | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | exit /b | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | ::======================================================================================================================================== | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | set "blank=" | 
					
						
							| 
									
										
										
										
											2023-09-30 22:24:15 +02:00
										 |  |  | set "mas=ht%blank%tps%blank%://mass%blank%grave.dev/" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::  Check if Null service is working, it's important for the batch script | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | sc query Null | find /i "RUNNING" | 
					
						
							|  |  |  | if %errorlevel% NEQ 0 ( | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | echo Null service is not running, script may crash... | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2025-03-15 22:34:40 +01:00
										 |  |  | echo Check this webpage for help - %mas%fix_service | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | echo: | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ping 127.0.0.1 -n 20 | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | cls | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::  Check LF line ending | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | pushd "%~dp0" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | >nul findstr /v "$" "%~nx0" && ( | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | echo: | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing. | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2025-03-15 22:34:40 +01:00
										 |  |  | echo Check this webpage for help - %mas%troubleshoot | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | echo: | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | echo: | 
					
						
							|  |  |  | ping 127.0.0.1 -n 20 >nul | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | popd | 
					
						
							|  |  |  | exit /b | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | popd | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							|  |  |  | color 07 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | title  Extract $OEM$ Folder %masver% | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | set _args= | 
					
						
							|  |  |  | set _elev= | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set _unattended=0 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | set _args=%* | 
					
						
							|  |  |  | if defined _args set _args=%_args:"=% | 
					
						
							| 
									
										
										
										
											2024-10-30 05:59:31 +01:00
										 |  |  | if defined _args set _args=%_args:re1=% | 
					
						
							|  |  |  | if defined _args set _args=%_args:re2=% | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | if defined _args ( | 
					
						
							|  |  |  | for %%A in (%_args%) do ( | 
					
						
							|  |  |  | if /i "%%A"=="-el"                    set _elev=1 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set "nul1=1>nul" | 
					
						
							|  |  |  | set "nul2=2>nul" | 
					
						
							|  |  |  | set "nul6=2^>nul" | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | set "nul=>nul 2>&1" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | call :dk_setvar | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | if %winbuild% EQU 1 ( | 
					
						
							|  |  |  | %eline% | 
					
						
							|  |  |  | echo Failed to detect Windows build number. | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | setlocal EnableDelayedExpansion | 
					
						
							|  |  |  | set fixes=%fixes% %mas%troubleshoot | 
					
						
							| 
									
										
										
										
											2025-03-15 22:34:40 +01:00
										 |  |  | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | goto done2 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | if %winbuild% LSS 6001 ( | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | %nceline% | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | echo Unsupported OS version detected [%winbuild%]. | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | echo MAS only supports Windows Vista/7/8/8.1/10/11 and their Server equivalents. | 
					
						
							|  |  |  | if %winbuild% EQU 6000 ( | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | echo Windows Vista RTM is not supported because Powershell cannot be installed. | 
					
						
							|  |  |  | echo Upgrade to Windows Vista SP1 or SP2. | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if not exist %ps% ( | 
					
						
							|  |  |  | %nceline% | 
					
						
							|  |  |  | echo PowerShell is not installed in your system. | 
					
						
							|  |  |  | if %winbuild% LSS 7600 ( | 
					
						
							|  |  |  | echo Install PowerShell using the following URL. | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | echo https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 | 
					
						
							|  |  |  | start https://www.catalog.update.microsoft.com/Search.aspx?q=KB968930 | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | ::  Fix special character limitations in path name | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | set "_work=%~dp0" | 
					
						
							|  |  |  | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set "_batf=%~f0" | 
					
						
							|  |  |  | set "_batp=%_batf:'=''%" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | set _PSarg="""%~f0""" -el %_args% | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set _PSarg=%_PSarg:'=''% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | set "_ttemp=%userprofile%\AppData\Local\Temp" | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | setlocal EnableDelayedExpansion | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | echo "!_batf!" | find /i "!_ttemp!" %nul1% && ( | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | if /i not "!_work!"=="!_ttemp!" ( | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | %eline% | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | echo The script was launched from the temp folder. | 
					
						
							|  |  |  | echo You are most likely running the script directly from the archive file. | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | echo: | 
					
						
							|  |  |  | echo Extract the archive file and launch the script from the extracted folder. | 
					
						
							|  |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-23 16:06:55 +01:00
										 |  |  | ::  Elevate script as admin and pass arguments and preventing loop | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %nul1% fltmc || ( | 
					
						
							|  |  |  | if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg!\"' -verb runas" && exit /b | 
					
						
							|  |  |  | %eline% | 
					
						
							|  |  |  | echo This script needs admin rights. | 
					
						
							|  |  |  | echo Right click on this script and select 'Run as administrator'. | 
					
						
							|  |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ::  Check PowerShell | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-23 16:06:55 +01:00
										 |  |  | ::pstst $ExecutionContext.SessionState.LanguageMode :pstst | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-16 23:41:21 +02:00
										 |  |  | for /f "delims=" %%a in ('%psc% "if ($PSVersionTable.PSEdition -ne 'Core') {$f=[io.file]::ReadAllText('!_batp!') -split ':pstst';iex ($f[1])}" %nul6%') do (set tstresult=%%a) | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-23 20:06:35 +01:00
										 |  |  | if /i not "%tstresult%"=="FullLanguage" ( | 
					
						
							|  |  |  | %eline% | 
					
						
							| 
									
										
										
										
											2025-04-13 00:15:34 +02:00
										 |  |  | echo: %tstresult% | 
					
						
							| 
									
										
										
										
											2025-02-23 20:06:35 +01:00
										 |  |  | cmd /c "%psc% $ExecutionContext.SessionState.LanguageMode" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | REM check LanguageMode | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cmd /c "%psc% "$ExecutionContext.SessionState.LanguageMode"" | findstr /i "ConstrainedLanguage RestrictedLanguage NoLanguage" %nul1% && ( | 
					
						
							|  |  |  | echo FullLanguage mode not found in PowerShell. Aborting... | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | echo If you have applied restrictions on Powershell then undo those changes. | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | set fixes=%fixes% %mas%fix_powershell | 
					
						
							| 
									
										
										
										
											2025-03-15 22:34:40 +01:00
										 |  |  | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%fix_powershell" | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-23 20:06:35 +01:00
										 |  |  | REM check Powershell core version | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cmd /c "%psc% "$PSVersionTable.PSEdition"" | find /i "Core" %nul1% && ( | 
					
						
							|  |  |  | echo Windows Powershell is needed for MAS but it seems to be replaced with Powershell core. Aborting... | 
					
						
							|  |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-13 00:55:10 +02:00
										 |  |  | REM check for Mal-ware that may cause issues with Powershell | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | for /r "%ProgramFiles%\" %%f in (secureboot.exe) do if exist "%%f" ( | 
					
						
							|  |  |  | echo "%%f" | 
					
						
							|  |  |  | echo Mal%blank%ware found, PowerShell is not working properly. | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | set fixes=%fixes% %mas%remove_mal%w%ware | 
					
						
							|  |  |  | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%remove_mal%w%ware" | 
					
						
							|  |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-23 20:06:35 +01:00
										 |  |  | REM check antivirus and other errors | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-23 16:06:55 +01:00
										 |  |  | 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 }""" | 
					
						
							|  |  |  | echo: | 
					
						
							|  |  |  | set fixes=%fixes% %mas%troubleshoot | 
					
						
							| 
									
										
										
										
											2025-03-15 22:34:40 +01:00
										 |  |  | call :dk_color2 %Blue% "Check this webpage for help - " %_Yellow% " %mas%troubleshoot" | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ::  Disable QuickEdit and launch from conhost.exe to avoid Terminal app | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | if %winbuild% GEQ 17763 ( | 
					
						
							|  |  |  | set terminal=1 | 
					
						
							|  |  |  | ) else ( | 
					
						
							|  |  |  | set terminal= | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ::  Check if script is running in Terminal app | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if defined terminal ( | 
					
						
							| 
									
										
										
										
											2025-04-14 00:40:58 +02:00
										 |  |  | set lines=0 | 
					
						
							|  |  |  | for /f "skip=2 tokens=2 delims=: " %%A in ('mode con') do if "!lines!"=="0" set lines=%%A | 
					
						
							|  |  |  | if !lines! GEQ 100 set terminal= | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if %_unattended%==1 goto :skipQE | 
					
						
							|  |  |  | for %%# in (%_args%) do (if /i "%%#"=="-qedit" goto :skipQE) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-14 00:40:58 +02:00
										 |  |  | ::  Relaunch to disable QuickEdit in the current session and use conhost.exe instead of the Terminal app | 
					
						
							|  |  |  | ::  This code disables QuickEdit for the current cmd.exe session without making permanent registry changes | 
					
						
							|  |  |  | ::  It is included because clicking on the script window can pause execution, causing confusion that the script has stopped due to an error | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-14 00:40:58 +02:00
										 |  |  | set resetQE=1 | 
					
						
							|  |  |  | reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE=0 | 
					
						
							|  |  |  | reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1% | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-14 00:40:58 +02:00
										 |  |  | if defined terminal ( | 
					
						
							|  |  |  | start conhost.exe "!_batf!" %_args% -qedit | 
					
						
							|  |  |  | start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% | 
					
						
							|  |  |  | exit /b | 
					
						
							|  |  |  | ) else if %resetQE% EQU 1 ( | 
					
						
							|  |  |  | start cmd.exe /c ""!_batf!" %_args% -qedit" | 
					
						
							|  |  |  | start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1% | 
					
						
							|  |  |  | exit /b | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | :skipQE | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | ::  Check for updates | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set -= | 
					
						
							|  |  |  | set old= | 
					
						
							| 
									
										
										
										
											2025-02-22 16:22:26 +01:00
										 |  |  | set pingp= | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | set upver=%masver:.=% | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-22 16:22:26 +01:00
										 |  |  | for %%A in ( | 
					
						
							|  |  |  | activ%-%ated.win | 
					
						
							|  |  |  | mass%-%grave.dev | 
					
						
							|  |  |  | ) do if not defined pingp ( | 
					
						
							|  |  |  | for /f "delims=[] tokens=2" %%B in ('ping -n 1 %%A') do ( | 
					
						
							|  |  |  | if not "%%B"=="" (set old=1& set pingp=1) | 
					
						
							|  |  |  | for /f "delims=[] tokens=2" %%C in ('ping -n 1 updatecheck%upver%.%%A') do ( | 
					
						
							|  |  |  | if not "%%C"=="" set old= | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if defined old ( | 
					
						
							|  |  |  | echo ________________________________________________ | 
					
						
							|  |  |  | %eline% | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | echo Your version of MAS [%masver%] is outdated. | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | echo ________________________________________________ | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | if not %_unattended%==1 ( | 
					
						
							| 
									
										
										
										
											2023-11-15 22:03:20 +01:00
										 |  |  | echo [1] Get Latest MAS | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | echo [0] Continue Anyway | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | call :dk_color %_Green% "Choose a menu option using your keyboard [1,0] :" | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | choice /C:10 /N | 
					
						
							|  |  |  | if !errorlevel!==2 rem | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | if !errorlevel!==1 (start %mas% & exit /b) | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | setlocal DisableDelayedExpansion | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::  Check desktop location | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set desktop= | 
					
						
							|  |  |  | for /f "skip=2 tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') do call set "desktop=%%b" | 
					
						
							|  |  |  | if not defined desktop for /f "delims=" %%a in ('%psc% "& {write-host $([Environment]::GetFolderPath('Desktop'))}"') do call set "desktop=%%a" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set "_pdesk=%desktop:'=''%" | 
					
						
							|  |  |  | set "_dir=%desktop%\$OEM$\$$\Setup\Scripts" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if exist "!desktop!\" ( | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | %eline% | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | echo Unable to detect Desktop location, aborting... | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | setlocal EnableDelayedExpansion | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | if not defined terminal mode 78, 30 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | if exist "!desktop!\$OEM$\" ( | 
					
						
							|  |  |  | echo _____________________________________________________ | 
					
						
							|  |  |  | %eline% | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | echo The $OEM$ folder already exists on your Desktop. | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | echo _____________________________________________________ | 
					
						
							|  |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-16 19:11:04 +01:00
										 |  |  | set HWID_Activation.cmd=Activators\HWID_Activation.cmd | 
					
						
							|  |  |  | set KMS38_Activation.cmd=Activators\KMS38_Activation.cmd | 
					
						
							|  |  |  | set Online_KMS_Activation.cmd=Activators\Online_KMS_Activation.cmd | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | set Ohook_Activation_AIO.cmd=Activators\Ohook_Activation_AIO.cmd | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | set TSforge_Activation.cmd=Activators\TSforge_Activation.cmd | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | pushd "!_work!" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set _nofile= | 
					
						
							|  |  |  | for %%# in ( | 
					
						
							|  |  |  | %HWID_Activation.cmd% | 
					
						
							|  |  |  | %KMS38_Activation.cmd% | 
					
						
							| 
									
										
										
										
											2023-03-16 19:11:04 +01:00
										 |  |  | %Online_KMS_Activation.cmd% | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | %Ohook_Activation_AIO.cmd% | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | %TSforge_Activation.cmd% | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | ) do ( | 
					
						
							|  |  |  | if not exist "%%#" set _nofile=1 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | popd | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if defined _nofile ( | 
					
						
							|  |  |  | echo _____________________________________________________ | 
					
						
							|  |  |  | %eline% | 
					
						
							|  |  |  | echo Some files are missing in the 'Activators' folder. | 
					
						
							|  |  |  | echo _____________________________________________________ | 
					
						
							|  |  |  | goto done2 | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :Menu | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | if not defined terminal mode 78, 30 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | echo: | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | echo: | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2023-03-16 19:11:04 +01:00
										 |  |  | echo:                     Extract $OEM$ folder on the desktop            | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | echo:         ____________________________________________________________ | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | echo: | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | echo:            [1] HWID             [Windows] | 
					
						
							|  |  |  | echo:            [2] Ohook            [Office] | 
					
						
							|  |  |  | echo:            [3] TSforge          [Windows / ESU / Office] | 
					
						
							|  |  |  | echo:            [4] KMS38            [Windows] | 
					
						
							|  |  |  | echo:            [5] Online KMS       [Windows / Office] | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | echo: | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | echo:            [6] HWID    [Windows] ^+ Ohook [Office] | 
					
						
							|  |  |  | echo:            [7] HWID    [Windows] ^+ Ohook [Office] ^+ TSforge [ESU] | 
					
						
							|  |  |  | echo:            [8] TSforge [Windows] ^+ Online KMS [Office] | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | echo: | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | call :dk_color2 %_White% "            [R] " %_Green% "ReadMe" | 
					
						
							|  |  |  | echo:            [0] Exit | 
					
						
							|  |  |  | echo:         ____________________________________________________________ | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | echo:   | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | call :dk_color2 %_White% "             " %_Green% "Choose a menu option using your keyboard :" | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | choice /C:12345678R0 /N | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | set _erl=%errorlevel% | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | if %_erl%==10 exit /b | 
					
						
							|  |  |  | if %_erl%==9 start %mas%oem-folder &goto :Menu | 
					
						
							|  |  |  | if %_erl%==8 goto:tsforge_kms | 
					
						
							|  |  |  | if %_erl%==7 goto:hwid_ohook_tsforge | 
					
						
							|  |  |  | if %_erl%==6 goto:hwid_ohook | 
					
						
							|  |  |  | if %_erl%==5 goto:kms | 
					
						
							|  |  |  | if %_erl%==4 goto:kms38 | 
					
						
							|  |  |  | if %_erl%==3 goto:tsforge | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | if %_erl%==2 goto:ohook | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | if %_erl%==1 goto:hwid | 
					
						
							|  |  |  | goto :Menu | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :hwid | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							|  |  |  | pushd "!_work!" | 
					
						
							|  |  |  | copy /y /b "%HWID_Activation.cmd%" "!_dir!\HWID_Activation.cmd" %nul% | 
					
						
							|  |  |  | popd | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | call :export hwid_setup | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | set _error= | 
					
						
							|  |  |  | if not exist "!_dir!\HWID_Activation.cmd" set _error=1 | 
					
						
							|  |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | if defined _error goto errorfound | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | set oem=HWID | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :hwid_setup: | 
					
						
							|  |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | fltmc >nul || exit /b | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | call "%~dp0HWID_Activation.cmd" /HWID | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							|  |  |  | :hwid_setup: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | :ohook | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | pushd "!_work!" | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | copy /y /b %Ohook_Activation_AIO.cmd% "!_dir!\Ohook_Activation_AIO.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | popd | 
					
						
							|  |  |  | call :export ohook_setup | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set _error= | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | if not exist "!_dir!\Ohook_Activation_AIO.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							|  |  |  | if defined _error goto errorfound | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set oem=Ohook | 
					
						
							|  |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :ohook_setup: | 
					
						
							|  |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fltmc >nul || exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | call "%~dp0Ohook_Activation_AIO.cmd" /Ohook | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							|  |  |  | :ohook_setup: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | :tsforge | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							|  |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							|  |  |  | pushd "!_work!" | 
					
						
							|  |  |  | copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul% | 
					
						
							|  |  |  | popd | 
					
						
							|  |  |  | call :export tsforge_setup | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set _error= | 
					
						
							|  |  |  | if not exist "!_dir!\TSforge_Activation.cmd" set _error=1 | 
					
						
							|  |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							|  |  |  | if defined _error goto errorfound | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set oem=TSforge | 
					
						
							|  |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :tsforge_setup: | 
					
						
							|  |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fltmc >nul || exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | call "%~dp0TSforge_Activation.cmd" /Z-WindowsESUOffice | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							|  |  |  | :tsforge_setup: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | :kms38 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							|  |  |  | pushd "!_work!" | 
					
						
							|  |  |  | copy /y /b "%KMS38_Activation.cmd%" "!_dir!\KMS38_Activation.cmd" %nul% | 
					
						
							|  |  |  | popd | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | call :export kms38_setup | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | set _error= | 
					
						
							|  |  |  | if not exist "!_dir!\KMS38_Activation.cmd" set _error=1 | 
					
						
							|  |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | if defined _error goto errorfound | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | set oem=KMS38 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :kms38_setup: | 
					
						
							|  |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | fltmc >nul || exit /b | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | call "%~dp0KMS38_Activation.cmd" /KMS38 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							|  |  |  | :kms38_setup: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :kms | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2023-03-16 19:11:04 +01:00
										 |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | pushd "!_work!" | 
					
						
							| 
									
										
										
										
											2023-03-16 19:11:04 +01:00
										 |  |  | copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | popd | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | call :export kms_setup | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | set _error= | 
					
						
							| 
									
										
										
										
											2023-03-16 19:11:04 +01:00
										 |  |  | if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							|  |  |  | if defined _error goto errorfound | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set oem=Online KMS | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :kms_setup: | 
					
						
							|  |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 20:03:00 +02:00
										 |  |  | fltmc >nul || exit /b | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | call "%~dp0Online_KMS_Activation.cmd" /K-WindowsOffice | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							|  |  |  | :kms_setup: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | :hwid_ohook | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | pushd "!_work!" | 
					
						
							|  |  |  | copy /y /b "%HWID_Activation.cmd%" "!_dir!\HWID_Activation.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | copy /y /b "%Ohook_Activation_AIO.cmd%" "!_dir!\Ohook_Activation_AIO.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | popd | 
					
						
							|  |  |  | call :export hwid_ohook_setup | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set _error= | 
					
						
							|  |  |  | if not exist "!_dir!\HWID_Activation.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | if not exist "!_dir!\Ohook_Activation_AIO.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							|  |  |  | if defined _error goto errorfound | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set oem=HWID [Windows] + Ohook [Office] | 
					
						
							|  |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :hwid_ohook_setup: | 
					
						
							|  |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fltmc >nul || exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | setlocal | 
					
						
							| 
									
										
										
										
											2023-10-16 04:50:03 +02:00
										 |  |  | call "%~dp0HWID_Activation.cmd" /HWID | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | endlocal | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | setlocal | 
					
						
							|  |  |  | call "%~dp0Ohook_Activation_AIO.cmd" /Ohook | 
					
						
							|  |  |  | endlocal | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							|  |  |  | :hwid_ohook_setup: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | :hwid_ohook_tsforge | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2023-03-16 19:11:04 +01:00
										 |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | pushd "!_work!" | 
					
						
							|  |  |  | copy /y /b "%HWID_Activation.cmd%" "!_dir!\HWID_Activation.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | copy /y /b "%Ohook_Activation_AIO.cmd%" "!_dir!\Ohook_Activation_AIO.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | popd | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | call :export hwid_ohook_tsforge_setup | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | set _error= | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | if not exist "!_dir!\HWID_Activation.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | if not exist "!_dir!\Ohook_Activation_AIO.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | if not exist "!_dir!\TSforge_Activation.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							|  |  |  | if defined _error goto errorfound | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | set oem=HWID [Windows] + Ohook [Office] + TSforge [ESU] | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | :hwid_ohook_tsforge_setup: | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fltmc >nul || exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | setlocal | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | call "%~dp0HWID_Activation.cmd" /HWID | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | endlocal | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | setlocal | 
					
						
							|  |  |  | call "%~dp0Ohook_Activation_AIO.cmd" /Ohook | 
					
						
							|  |  |  | endlocal | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | setlocal | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | call "%~dp0TSforge_Activation.cmd" /Z-ESU | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | endlocal | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | :hwid_ohook_tsforge_setup: | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | :tsforge_kms | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cls | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | md "!desktop!\$OEM$\$$\Setup\Scripts" | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | pushd "!_work!" | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | copy /y /b "%TSforge_Activation.cmd%" "!_dir!\TSforge_Activation.cmd" %nul% | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | copy /y /b "%Online_KMS_Activation.cmd%" "!_dir!\Online_KMS_Activation.cmd" %nul% | 
					
						
							|  |  |  | popd | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | call :export tsforge_kms_setup | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | set _error= | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | if not exist "!_dir!\TSforge_Activation.cmd" set _error=1 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | if not exist "!_dir!\Online_KMS_Activation.cmd" set _error=1 | 
					
						
							|  |  |  | if not exist "!_dir!\SetupComplete.cmd" set _error=1 | 
					
						
							|  |  |  | if defined _error goto errorfound | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | set oem=TSforge [Windows] + Online KMS [Office] | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | goto done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | :tsforge_kms_setup: | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | @echo off | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | fltmc >nul || exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | setlocal | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | call "%~dp0TSforge_Activation.cmd" /Z-Windows | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | endlocal | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | setlocal | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | call "%~dp0Online_KMS_Activation.cmd" /K-Office | 
					
						
							| 
									
										
										
										
											2023-10-21 02:01:26 +02:00
										 |  |  | endlocal | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | cd \ | 
					
						
							|  |  |  | (goto) 2>nul & (if "%~dp0"=="%SystemRoot%\Setup\Scripts\" rd /s /q "%~dp0") | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | :tsforge_kms_setup: | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | :errorfound | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | %eline% | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | echo The script failed to create the $OEM$ folder. | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | goto :done2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :done | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | echo ______________________________________________________________ | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | echo: | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | call :dk_color %Blue% "%oem%" | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | call :dk_color %Green% "$OEM$ folder was successfully created on your Desktop." | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | echo "%oem%" | find /i "38" %nul% && ( | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2025-02-13 18:40:49 +01:00
										 |  |  | echo To KMS38 activate Server Cor/Acor editions [No GUI Versions], | 
					
						
							| 
									
										
										
										
											2023-09-30 22:24:15 +02:00
										 |  |  | echo Check this page %mas%oem-folder | 
					
						
							| 
									
										
										
										
											2022-11-07 21:33:01 +01:00
										 |  |  | ) | 
					
						
							|  |  |  | echo ______________________________________________________________ | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | :done2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | echo: | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | if defined fixes ( | 
					
						
							| 
									
										
										
										
											2024-11-08 00:51:08 +01:00
										 |  |  | call :dk_color %White% "Follow ALL the ABOVE blue lines.   " | 
					
						
							| 
									
										
										
										
											2024-09-27 04:34:25 +02:00
										 |  |  | call :dk_color2 %Blue% "Press [1] to Open Support Webpage " %Gray% " Press [0] to Ignore" | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | choice /C:10 /N | 
					
						
							|  |  |  | if !errorlevel!==1 (for %%# in (%fixes%) do (start %%#)) | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if defined terminal ( | 
					
						
							| 
									
										
										
										
											2024-08-20 19:15:06 +02:00
										 |  |  | call :dk_color %_Yellow% "Press [0] key to %_exitmsg%..." | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | choice /c 0 /n | 
					
						
							|  |  |  | ) else ( | 
					
						
							|  |  |  | call :dk_color %_Yellow% "Press any key to %_exitmsg%..." | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | pause %nul1% | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::  Set variables | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :dk_setvar | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | set ps=%SysPath%\WindowsPowerShell\v1.0\powershell.exe | 
					
						
							|  |  |  | set psc=%ps% -nop -c | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set winbuild=1 | 
					
						
							|  |  |  | for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | set _slexe=sppsvc.exe& set _slser=sppsvc | 
					
						
							|  |  |  | if %winbuild% LEQ 6300 (set _slexe=SLsvc.exe& set _slser=SLsvc) | 
					
						
							|  |  |  | if %winbuild% LSS 7600 if exist "%SysPath%\SLsvc.exe" (set _slexe=SLsvc.exe& set _slser=SLsvc) | 
					
						
							|  |  |  | if %_slexe%==SLsvc.exe set _vis=1 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set _NCS=1 | 
					
						
							|  |  |  | if %winbuild% LSS 10586 set _NCS=0 | 
					
						
							|  |  |  | if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-30 05:59:31 +01:00
										 |  |  | echo "%PROCESSOR_ARCHITECTURE% %PROCESSOR_ARCHITEW6432%" | find /i "ARM64" %nul1% && (if %winbuild% LSS 21277 set ps32onArm=1) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | if %_NCS% EQU 1 ( | 
					
						
							|  |  |  | for /F %%a in ('echo prompt $E ^| cmd') do set "esc=%%a" | 
					
						
							|  |  |  | set     "Red="41;97m"" | 
					
						
							|  |  |  | set    "Gray="100;97m"" | 
					
						
							|  |  |  | set   "Green="42;97m"" | 
					
						
							|  |  |  | set    "Blue="44;97m"" | 
					
						
							| 
									
										
										
										
											2024-11-08 00:51:08 +01:00
										 |  |  | set   "White="107;91m"" | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set    "_Red="40;91m"" | 
					
						
							|  |  |  | set  "_White="40;37m"" | 
					
						
							|  |  |  | set  "_Green="40;92m"" | 
					
						
							|  |  |  | set "_Yellow="40;93m"" | 
					
						
							|  |  |  | ) else ( | 
					
						
							|  |  |  | set     "Red="Red" "white"" | 
					
						
							|  |  |  | set    "Gray="Darkgray" "white"" | 
					
						
							|  |  |  | set   "Green="DarkGreen" "white"" | 
					
						
							|  |  |  | set    "Blue="Blue" "white"" | 
					
						
							| 
									
										
										
										
											2024-11-08 15:40:19 +01:00
										 |  |  | set   "White="White" "Red"" | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | set    "_Red="Black" "Red"" | 
					
						
							|  |  |  | set  "_White="Black" "Gray"" | 
					
						
							|  |  |  | set  "_Green="Black" "Green"" | 
					
						
							|  |  |  | set "_Yellow="Black" "Yellow"" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | set "nceline=echo: &echo ==== ERROR ==== &echo:" | 
					
						
							|  |  |  | set "eline=echo: &call :dk_color %Red% "==== ERROR ====" &echo:" | 
					
						
							|  |  |  | if %~z0 GEQ 200000 ( | 
					
						
							|  |  |  | set "_exitmsg=Go back" | 
					
						
							|  |  |  | set "_fixmsg=Go back to Main Menu, select Troubleshoot and run Fix Licensing option." | 
					
						
							|  |  |  | ) else ( | 
					
						
							|  |  |  | set "_exitmsg=Exit" | 
					
						
							|  |  |  | set "_fixmsg=In MAS folder, run Troubleshoot script and select Fix Licensing option." | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::  Extract the text from batch script without character and file encoding issue | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | :export | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | %psc% "$f=[io.file]::ReadAllText('!_batp!') -split \":%~1\:.*`r`n\"; [io.file]::WriteAllText('!_pdesk!\$OEM$\$$\Setup\Scripts\SetupComplete.cmd',$f[1].Trim(),[System.Text.Encoding]::ASCII);" | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | :dk_color | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | if %_NCS% EQU 1 ( | 
					
						
							|  |  |  | echo %esc%[%~1%~2%esc%[0m | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | ) else if exist %ps% ( | 
					
						
							| 
									
										
										
										
											2024-08-19 15:13:14 +02:00
										 |  |  | %psc% write-host -back '%1' -fore '%2' '%3' | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | ) else if not exist %ps% ( | 
					
						
							|  |  |  | echo %~3 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-16 00:42:38 +02:00
										 |  |  | :dk_color2 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | if %_NCS% EQU 1 ( | 
					
						
							|  |  |  | echo %esc%[%~1%~2%esc%[%~3%~4%esc%[0m | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | ) else if exist %ps% ( | 
					
						
							| 
									
										
										
										
											2024-08-19 15:13:14 +02:00
										 |  |  | %psc% write-host -back '%1' -fore '%2' '%3' -NoNewline; write-host -back '%4' -fore '%5' '%6' | 
					
						
							| 
									
										
										
										
											2025-04-20 16:05:53 +02:00
										 |  |  | ) else if not exist %ps% ( | 
					
						
							|  |  |  | echo %~3 %~6 | 
					
						
							| 
									
										
										
										
											2022-07-25 19:08:12 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | exit /b | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-25 15:46:19 +02:00
										 |  |  | ::======================================================================================================================================== | 
					
						
							|  |  |  | :: Leave empty line below |