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
|
||||
|
||||
|
||||
@@ -68,6 +68,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"
|
||||
@@ -145,8 +157,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:
|
||||
@@ -155,10 +166,8 @@ echo Check this webpage for help - %mas%troubleshoot
|
||||
echo:
|
||||
echo:
|
||||
ping 127.0.0.1 -n 20 >nul
|
||||
popd
|
||||
exit /b
|
||||
)
|
||||
popd
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
@@ -245,10 +254,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"
|
||||
@@ -257,7 +265,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.
|
||||
@@ -387,11 +395,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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user