mirror of
https://github.com/massgravel/Microsoft-Activation-Scripts.git
synced 2025-04-10 23:34:55 +00:00
2.4
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
@set masver=2.3
|
||||
@set masver=2.4
|
||||
@setlocal DisableDelayedExpansion
|
||||
@echo off
|
||||
|
||||
@ -138,14 +138,18 @@ if /i "%%A"=="-el" (set _elev=1
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
set "nul1=1>nul"
|
||||
set "nul2=2>nul"
|
||||
set "nul6=2^>nul"
|
||||
set "nul=>nul 2>&1"
|
||||
|
||||
set psc=powershell.exe
|
||||
set winbuild=1
|
||||
for /f "tokens=6 delims=[]. " %%G in ('ver') do set winbuild=%%G
|
||||
|
||||
set _NCS=1
|
||||
if %winbuild% LSS 10586 set _NCS=0
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 2>nul | find /i "0x0" 1>nul && (set _NCS=0)
|
||||
if %winbuild% GEQ 10586 reg query "HKCU\Console" /v ForceV2 %nul2% | find /i "0x0" %nul1% && (set _NCS=0)
|
||||
|
||||
call :_colorprep
|
||||
set "_buf={$W=$Host.UI.RawUI.WindowSize;$B=$Host.UI.RawUI.BufferSize;$W.Height=31;$B.Height=300;$Host.UI.RawUI.WindowSize=$W;$Host.UI.RawUI.BufferSize=$B;}"
|
||||
@ -188,7 +192,7 @@ setlocal EnableDelayedExpansion
|
||||
|
||||
::========================================================================================================================================
|
||||
|
||||
echo "!_batf!" | find /i "!_ttemp!" 1>nul && (
|
||||
echo "!_batf!" | find /i "!_ttemp!" %nul1% && (
|
||||
if /i not "!_work!"=="!_ttemp!" (
|
||||
%nceline%
|
||||
echo Script is launched from the temp folder,
|
||||
@ -203,10 +207,10 @@ goto Done
|
||||
|
||||
:: Elevate script as admin and pass arguments and preventing loop
|
||||
|
||||
>nul fltmc || (
|
||||
%nul1% fltmc || (
|
||||
if not defined _elev %psc% "start cmd.exe -arg '/c \"!_PSarg:'=''!\"' -verb runas" && exit /b
|
||||
%nceline%
|
||||
echo This script require admin privileges.
|
||||
echo This script requires admin privileges.
|
||||
echo To do so, right click on this script and select 'Run as administrator'.
|
||||
goto Done
|
||||
)
|
||||
@ -219,8 +223,8 @@ goto Done
|
||||
if defined _unattended set quedit=1
|
||||
for %%# in (%_args%) do (if /i "%%#"=="-qedit" set quedit=1)
|
||||
|
||||
reg query HKCU\Console /v QuickEdit 2>nul | find /i "0x0" %nul% || if not defined quedit (
|
||||
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul%
|
||||
reg query HKCU\Console /v QuickEdit %nul2% | find /i "0x0" %nul1% || if not defined quedit (
|
||||
reg add HKCU\Console /v QuickEdit /t REG_DWORD /d "0" /f %nul1%
|
||||
start cmd.exe /c ""!_batf!" %_args% -qedit"
|
||||
rem quickedit reset code is added at the starting of the script instead of here because it takes time to reflect in some cases
|
||||
exit /b
|
||||
@ -233,8 +237,8 @@ exit /b
|
||||
set -=
|
||||
set old=
|
||||
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -n 1 updatecheck.mass%-%grave.dev') do (
|
||||
if not [%%#]==[] echo "%%#" | find "127.69.%masver%" %nul1% || set old=1
|
||||
for /f "delims=[] tokens=2" %%# in ('ping -4 -n 1 updatecheck.mass%-%grave.dev') do (
|
||||
if not [%%#]==[] (echo "%%#" | find "127.69" %nul1% && (echo "%%#" | find "127.69.%masver%" %nul1% || set old=1))
|
||||
)
|
||||
|
||||
if defined old (
|
||||
|
Reference in New Issue
Block a user