mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2026-07-04 15:48:21 +00:00
MAS 3.12
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
@set masver=3.11
|
||||
@set masver=3.12
|
||||
@echo off
|
||||
|
||||
|
||||
@@ -35,6 +35,18 @@ set "Path=%SystemRoot%\Sysnative;%SystemRoot%;%SystemRoot%\Sysnative\Wbem;%Syste
|
||||
set "ComSpec=%SysPath%\cmd.exe"
|
||||
set "PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;%SysPath%\WindowsPowerShell\v1.0\Modules"
|
||||
|
||||
cd /d "%SysPath%"
|
||||
|
||||
:: Workaround for https://github.com/microsoft/terminal/issues/15212, when %0 starts with a quote %0 parameter expansion is not specialcased.
|
||||
:: Changing %0 to something that is not quoted bypasses the issue.
|
||||
goto arg_workaround_end
|
||||
:arg_workaround
|
||||
set "_cmdf=%~f0"
|
||||
exit /b
|
||||
:arg_workaround_end
|
||||
|
||||
call :arg_workaround
|
||||
|
||||
set re1=
|
||||
set re2=
|
||||
set "_cmdf=%~f0"
|
||||
@@ -85,8 +97,7 @@ cls
|
||||
|
||||
:: Check LF line ending
|
||||
|
||||
pushd "%~dp0"
|
||||
>nul findstr /v "$" "%~nx0" && (
|
||||
>nul findstr /v "$" "%_cmdf%" && (
|
||||
echo:
|
||||
echo Error - Script either has LF line ending issue or an empty line at the end of the script is missing.
|
||||
echo:
|
||||
@@ -95,10 +106,8 @@ echo Check this webpage for help - %mas%troubleshoot
|
||||
echo:
|
||||
echo:
|
||||
ping 127.0.0.1 -n 20 >nul
|
||||
popd
|
||||
exit /b
|
||||
)
|
||||
popd
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
@@ -164,10 +173,9 @@ goto dk_done
|
||||
set "_work=%~dp0"
|
||||
if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%"
|
||||
|
||||
set "_batf=%~f0"
|
||||
set "_batp=%_batf:'=''%"
|
||||
set "_batp=%_cmdf:'=''%"
|
||||
|
||||
set _PSarg="""%~f0""" -el %_args%
|
||||
set _PSarg="""%_cmdf%""" -el %_args%
|
||||
set _PSarg=%_PSarg:'=''%
|
||||
|
||||
set "_ttemp=%userprofile%\AppData\Local\Temp"
|
||||
@@ -176,7 +184,7 @@ setlocal EnableDelayedExpansion
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||
echo "!_cmdf!" | find /i "!_ttemp!" %nul1% && (
|
||||
if /i not "!_work!"=="!_ttemp!" (
|
||||
%eline%
|
||||
echo The script was launched from the temp folder.
|
||||
@@ -306,11 +314,11 @@ reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% && set resetQE
|
||||
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d 0 /f %nul1%
|
||||
|
||||
if defined terminal (
|
||||
start conhost.exe "!_batf!" %_args% -qedit
|
||||
start conhost.exe "!_cmdf!" %_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 cmd.exe /c ""!_cmdf!" %_args% -qedit"
|
||||
start reg add HKCU\Console /v QuickEdit /t REG_DWORD /d %resetQE% /f %nul1%
|
||||
exit /b
|
||||
)
|
||||
@@ -827,8 +835,8 @@ exit /b
|
||||
|
||||
:: https://stackoverflow.com/a/46268232
|
||||
|
||||
set "ddf="%SystemRoot%\Temp\%Random%%Random%%Random%%Random%""
|
||||
%nul% del /q /f %ddf%
|
||||
for /f %%G in ('%psc% "[Guid]::NewGuid().Guid"') do set "randguid=%%G"
|
||||
set "ddf="%SystemRoot%\Temp\%Random%%randguid%""
|
||||
echo/.New Cabinet>%ddf%
|
||||
echo/.set Cabinet=ON>>%ddf%
|
||||
echo/.set CabinetFileCountThreshold=0;>>%ddf%
|
||||
@@ -1293,7 +1301,7 @@ if($false -eq ($installCandidates.Keys -contains $SetEdition)) {
|
||||
Exit 1
|
||||
}
|
||||
|
||||
$xmlPath = $Env:SystemRoot + '\Temp' + '\CbsUpgrade.xml'
|
||||
$xmlPath = $Env:SystemRoot + '\Temp' + "\$([Guid]::NewGuid().Guid)CbsUpgrade.xml"
|
||||
|
||||
Write-UpgradeXml -RemovalCandidates $removalCandidates `
|
||||
-InstallCandidates $installCandidates[$SetEdition] `
|
||||
|
||||
Reference in New Issue
Block a user